Postgresql 7.3.2 User's Guide

Total Page:16

File Type:pdf, Size:1020Kb

Postgresql 7.3.2 User's Guide PostgreSQL 7.3.2 User’s Guide The PostgreSQL Global Development Group PostgreSQL 7.3.2 User’s Guide by The PostgreSQL Global Development Group Copyright © 1996-2002 by The PostgreSQL Global Development Group Legal Notice PostgreSQL is Copyright © 1996-2002 by the PostgreSQL Global Development Group and is distributed under the terms of the license of the University of California below. Postgres95 is Copyright © 1994-5 by the Regents of the University of California. Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PRO- VIDED HEREUNDER IS ON AN “AS-IS” BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. Table of Contents Preface ..................................................................................................................................................i 1. What is PostgreSQL? ...............................................................................................................i 2. A Short History of PostgreSQL ...............................................................................................i 2.1. The Berkeley POSTGRES Project .............................................................................ii 2.2. Postgres95...................................................................................................................ii 2.3. PostgreSQL................................................................................................................iii 3. What’s In This Book ..............................................................................................................iii 4. Overview of Documentation Resources.................................................................................iv 5. Terminology and Notation ......................................................................................................v 6. Bug Reporting Guidelines.......................................................................................................v 6.1. Identifying Bugs ........................................................................................................vi 6.2. What to report............................................................................................................vi 6.3. Where to report bugs ...............................................................................................viii 1. SQL Syntax......................................................................................................................................1 1.1. Lexical Structure ..................................................................................................................1 1.1.1. Identifiers and Key Words .......................................................................................1 1.1.2. Constants .................................................................................................................2 1.1.2.1. String Constants..........................................................................................2 1.1.2.2. Bit-String Constants....................................................................................3 1.1.2.3. Numeric Constants......................................................................................3 1.1.2.4. Constants of Other Types............................................................................4 1.1.2.5. Array constants ...........................................................................................4 1.1.3. Operators .................................................................................................................5 1.1.4. Special Characters ...................................................................................................5 1.1.5. Comments................................................................................................................6 1.1.6. Lexical Precedence..................................................................................................6 1.2. Value Expressions ................................................................................................................7 1.2.1. Column References .................................................................................................8 1.2.2. Positional Parameters ..............................................................................................8 1.2.3. Operator Invocations ...............................................................................................9 1.2.4. Function Calls..........................................................................................................9 1.2.5. Aggregate Expressions ............................................................................................9 1.2.6. Type Casts..............................................................................................................10 1.2.7. Scalar Subqueries ..................................................................................................10 1.2.8. Expression Evaluation ...........................................................................................11 2. Data Definition ..............................................................................................................................12 2.1. Table Basics .......................................................................................................................12 2.2. System Columns ................................................................................................................13 2.3. Default Values ....................................................................................................................14 2.4. Constraints .........................................................................................................................14 2.4.1. Check Constraints..................................................................................................15 2.4.2. Not-Null Constraints .............................................................................................16 2.4.3. Unique Constraints ................................................................................................17 2.4.4. Primary Keys .........................................................................................................18 2.4.5. Foreign Keys..........................................................................................................18 2.5. Inheritance..........................................................................................................................21 2.6. Modifying Tables ...............................................................................................................23 2.6.1. Adding a Column ..................................................................................................23 iii 2.6.2. Removing a Column..............................................................................................23 2.6.3. Adding a Constraint...............................................................................................23 2.6.4. Removing a Constraint ..........................................................................................24 2.6.5. Changing the Default.............................................................................................24 2.6.6. Renaming a Column..............................................................................................24 2.6.7. Renaming a Table ..................................................................................................24 2.7. Privileges............................................................................................................................25 2.8. Schemas .............................................................................................................................25 2.8.1. Creating a Schema.................................................................................................26 2.8.2. The Public Schema................................................................................................27 2.8.3. The Schema Search Path .......................................................................................27 2.8.4. Schemas and Privileges .........................................................................................28 2.8.5. The System Catalog Schema.................................................................................28 2.8.6. Usage Patterns .......................................................................................................29 2.8.7. Portability ..............................................................................................................29 2.9. Other Database Objects......................................................................................................30
Recommended publications
  • Ingres 9.3 Migration Guide
    Ingres® 9.3 Migration Guide ING-93-MG-02 This Documentation is for the end user's informational purposes only and may be subject to change or withdrawal by Ingres Corporation ("Ingres") at any time. This Documentation is the proprietary information of Ingres and is protected by the copyright laws of the United States and international treaties. It is not distributed under a GPL license. You may make printed or electronic copies of this Documentation provided that such copies are for your own internal use and all Ingres copyright notices and legends are affixed to each reproduced copy. You may publish or distribute this document, in whole or in part, so long as the document remains unchanged and is disseminated with the applicable Ingres software. Any such publication or distribution must be in the same manner and medium as that used by Ingres, e.g., electronic download via website with the software or on a CD- ROM. Any other use, such as any dissemination of printed copies or use of this documentation, in whole or in part, in another publication, requires the prior written consent from an authorized representative of Ingres. To the extent permitted by applicable law, INGRES PROVIDES THIS DOCUMENTATION "AS IS" WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. IN NO EVENT WILL INGRES BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR DAMAGE, DIRECT OR INDIRECT, FROM THE USER OF THIS DOCUMENTATION, INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF INGRES IS EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE.
    [Show full text]
  • The Ingres Next Initiative Enabling the Cloud, Mobile, and Web Journeys for Our Actian X and Ingres Database Customers
    The Ingres NeXt Initiative Enabling the Cloud, Mobile, and Web Journeys for our Actian X and Ingres Database Customers Any organization that has leveraged technology to help run their business Benefits knows that the costs associated with on-going maintenance and support for Accelerate Cost Savings legacy systems can often take the upwards of 50% of the budget. Analysts and • Seize near-term cost IT vendors tend to see these on-going investments as sub-optimum, but for reductions across your IT and mission critical systems that have served their organizations well for decades business operations and tight budgets, , the risk to operations and business continuity make • Leverage existing IT replacing these tried and tested mission critical systems impractical. In many investments and data sources cases, these essential systems contain thousands of hours of custom developed business logic investment. • Avoid new CAPEX cycles when Products such as Actian Ingres and, more recently Actian X Relational retiring legacy systems Database Management Systems (RDBMS), have proven Actian’s commitment to helping our customers maximize their existing investments without having Optimize Risk Mitigation to sacrifice modern functionality. Ultimately, this balance in preservation and • Preserve investments in existing business logic while innovation with Ingres has taken us to three areas of development and taking advantage of modern deployment: continuation of heritage UNIX variants on their associated capabilities hardware, current Linux and Windows for on-premise and virtualized environments and most importantly, enabling migration to the public cloud. • Same database across all platforms Based on a recent survey of our Actian X and Ingres customer base, we are seeing a growing desire to move database workloads to the Cloud.
    [Show full text]
  • Issue Purchase Order for Ingres Relational Database Management System Software Support
    BOARD MEETING DATE: December 5, 2014 AGENDA NO. 11 PROPOSAL: Issue Purchase Order for Ingres Relational Database Management System Software Support SYNOPSIS: The Ingres Relational Database Management System is used for the implementation of the Central Information Repository database. This database is used by most enterprise-level software applications at the SCAQMD and currently supports a suite of client/server and web-based applications known collectively as the Clean Air Support System (CLASS). The CLASS applications are used to support all of the SCAQMD core activities. Maintenance support for this software expires November 29, 2014. This action is to issue a three-year purchase order with Actian Corporation for a total amount of $564,967. Funds for this expense are included in the FY 2014-15 Budget and will be included in subsequent fiscal year budget requests. COMMITTEE: Administrative, November 14, 2014, Recommended for Approval RECOMMENDED ACTION: Authorize the Procurement Manager to issue a three-year purchase order with Actian Corporation (formerly Ingres Corporation) for Ingres Relational Database Management System software maintenance support, for the period of November 30, 2014 through November 29, 2017, for a total amount not to exceed $564,967. Barry R. Wallerstein, D.Env. Executive Officer JCM: MH:ZT:agg Background In November 2006, the SCAQMD entered into an annual support and maintenance agreement for Ingres Relational Database Management System (RDBMS) software. The RDBMS software runs on three database servers for production, development, and ad hoc reporting. The production server hosts the Central Information Repository database (DBCIR). This database supports a collection of more than 30 client/server and web-based applications known as the Clean Air Support System (CLASS).
    [Show full text]
  • Ingres 10.1 for Linux Quick Start Guide
    Ingres 10S Quick Start Guide ING-1001-QSL-03 This Documentation is for the end user's informational purposes only and may be subject to change or withdrawal by Actian Corporation ("Actian") at any time. This Documentation is the proprietary information of Actian and is protected by the copyright laws of the United States and international treaties. It is not distributed under a GPL license. You may make printed or electronic copies of this Documentation provided that such copies are for your own internal use and all Actian copyright notices and legends are affixed to each reproduced copy. You may publish or distribute this document, in whole or in part, so long as the document remains unchanged and is disseminated with the applicable Actian software. Any such publication or distribution must be in the same manner and medium as that used by Actian, e.g., electronic download via website with the software or on a CD- ROM. Any other use, such as any dissemination of printed copies or use of this documentation, in whole or in part, in another publication, requires the prior written consent from an authorized representative of Actian. To the extent permitted by applicable law, ACTIAN PROVIDES THIS DOCUMENTATION "AS IS" WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. IN NO EVENT WILL ACTIAN BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR DAMAGE, DIRECT OR INDIRECT, FROM THE USER OF THIS DOCUMENTATION, INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF ACTIAN IS EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE.
    [Show full text]
  • Ingres R3 Opensql Reference Guide
    Ingres OpenSQL Reference Guide r3 P00283-1E This documentation and related computer software program (hereinafter referred to as the “Documentation”) is for the end user’s informational purposes only and is subject to change or withdrawal by Computer Associates International, Inc. (“CA”) at any time. This documentation may not be copied, transferred, reproduced, disclosed or duplicated, in whole or in part, without the prior written consent of CA. This documentation is proprietary information of CA and protected by the copyright laws of the United States and international treaties. Notwithstanding the foregoing, licensed users may print a reasonable number of copies of this documentation for their own internal use, provided that all CA copyright notices and legends are affixed to each reproduced copy. Only authorized employees, consultants, or agents of the user who are bound by the confidentiality provisions of the license for the software are permitted to have access to such copies. This right to print copies is limited to the period during which the license for the product remains in full force and effect. Should the license terminate for any reason, it shall be the user’s responsibility to return to CA the reproduced copies or to certify to CA that same have been destroyed. To the extent permitted by applicable law, CA provides this documentation “as is” without warranty of any kind, including without limitation, any implied warranties of merchantability, fitness for a particular purpose or noninfringement. In no event will CA be liable to the end user or any third party for any loss or damage, direct or indirect, from the use of this documentation, including without limitation, lost profits, business interruption, goodwill, or lost data, even if CA is expressly advised of such loss or damage.
    [Show full text]
  • Pydal Documentation Release 15.03
    pyDAL Documentation Release 15.03 web2py-developers May 25, 2015 Contents 1 Indices and tables 3 1.1 Subpackages...............................................3 1.2 Submodules............................................... 28 1.3 pydal.base module............................................ 28 1.4 pydal.connection module......................................... 35 1.5 pydal.objects module........................................... 36 1.6 Module contents............................................. 44 Python Module Index 45 i ii pyDAL Documentation, Release 15.03 Contents: Contents 1 pyDAL Documentation, Release 15.03 2 Contents CHAPTER 1 Indices and tables • genindex • modindex • search 1.1 Subpackages 1.1.1 pydal.adapters package Submodules pydal.adapters.base module class pydal.adapters.base.AdapterMeta Bases: type Metaclass to support manipulation of adapter classes. At the moment is used to intercept entity_quoting argument passed to DAL. class pydal.adapters.base.BaseAdapter(db, uri, pool_size=0, folder=None, db_codec=’UTF- 8’, credential_decoder=<function IDENTITY at 0x7f781c8f6500>, driver_args={}, adapter_args={}, do_connect=True, after_connection=None) Bases: pydal.connection.ConnectionPool ADD(first, second) AGGREGATE(first, what) ALLOW_NULL() AND(first, second) AS(first, second) BELONGS(first, second) CASE(query, t, f ) CAST(first, second) COALESCE(first, second) 3 pyDAL Documentation, Release 15.03 COALESCE_ZERO(first) COMMA(first, second) CONCAT(*items) CONTAINS(first, second, case_sensitive=True) COUNT(first, distinct=None) DIV(first,
    [Show full text]
  • Looking Back at Postgres
    Looking Back at Postgres Joseph M. Hellerstein [email protected] ABSTRACT etc.""efficient spatial searching" "complex integrity constraints" and This is a recollection of the UC Berkeley Postgres project, which "design hierarchies and multiple representations" of the same phys- was led by Mike Stonebraker from the mid-1980’s to the mid-1990’s. ical constructions [SRG83]. Based on motivations such as these, the The article was solicited for Stonebraker’s Turing Award book[Bro19], group started work on indexing (including Guttman’s influential as one of many personal/historical recollections. As a result it fo- R-trees for spatial indexing [Gut84], and on adding Abstract Data cuses on Stonebraker’s design ideas and leadership. But Stonebraker Types (ADTs) to a relational database system. ADTs were a pop- was never a coder, and he stayed out of the way of his development ular new programming language construct at the time, pioneered team. The Postgres codebase was the work of a team of brilliant stu- by subsequent Turing Award winner Barbara Liskov and explored dents and the occasional university “staff programmers” who had in database application programming by Stonebraker’s new collab- little more experience (and only slightly more compensation) than orator, Larry Rowe. In a paper in SIGMOD Record in 1983 [OFS83], the students. I was lucky to join that team as a student during the Stonebraker and students James Ong and Dennis Fogg describe an latter years of the project. I got helpful input on this writeup from exploration of this idea as an extension to Ingres called ADT-Ingres, some of the more senior students on the project, but any errors or which included many of the representational ideas that were ex- omissions are mine.
    [Show full text]
  • Ingres 10.1 Connectivity Guide
    Ingres 10S Connectivity Guide ING-101-CN-05 This Documentation is for the end user's informational purposes only and may be subject to change or withdrawal by Actian Corporation ("Actian") at any time. This Documentation is the proprietary information of Actian and is protected by the copyright laws of the United States and international treaties. It is not distributed under a GPL license. You may make printed or electronic copies of this Documentation provided that such copies are for your own internal use and all Actian copyright notices and legends are affixed to each reproduced copy. You may publish or distribute this document, in whole or in part, so long as the document remains unchanged and is disseminated with the applicable Actian software. Any such publication or distribution must be in the same manner and medium as that used by Actian, e.g., electronic download via website with the software or on a CD- ROM. Any other use, such as any dissemination of printed copies or use of this documentation, in whole or in part, in another publication, requires the prior written consent from an authorized representative of Actian. To the extent permitted by applicable law, ACTIAN PROVIDES THIS DOCUMENTATION "AS IS" WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. IN NO EVENT WILL ACTIAN BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR DAMAGE, DIRECT OR INDIRECT, FROM THE USER OF THIS DOCUMENTATION, INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF ACTIAN IS EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE.
    [Show full text]
  • VMS Update #3 : Apr 2011
    TO :- VMS Champions SUBJECT:- VMS update #3 : Apr 2011 This is our third issue of OpenVMS update brought to you by OpenVMS customer programs office. Our endeavor is to give information that will be useful and gainful for you. I trust that you all like this new format which helps you get a quick glance of all the contents in this issue. Click on the pointers below and get full details. 1. OpenVMS Engineering update :- a. TUDs b. TechWise c. VMS support with rx2800 i2 servers d. Availability Manager v3.1 2. Partner Page :- a. Migration Specialties b. Ingres and OpenVMS c. Maklee d. OPC_UA_for_OpenVMS e. GNAT f. Golden Eggs 3. Community news! :- Job openings on OpenVMS Don’t miss the hp OpenVMS blog on OpenVMS , OpenVMS blogs A big thank you to all who contributed to this edition of the OpenVMS update. Keep contributing for the OpenVMS business. To unsubscribe write into :- [email protected] Thanks and Warm Regards, Sujatha Ramani Global Lead- Customer & Partner Technical programs 1. OpenVMS Engineering update :- a. TUDs in Asia Pacific region Please join us for these events. It is unique opportunity to meet with the engineering folks from OpenVMS lab. Our first TUD in 2011 is in Singapore on 28th and 29th April. Click to register for Singapore TUD We then move on to Australia and conduct 2 more TUDs there. One in Sydney on 2nd and 3rd May and one in Melbourne on 5th and 6th May. Click here to register for Australia. Please see attachment for the full details on Australia TUD.
    [Show full text]
  • THE DESIGN of POSTGRES Abstract 1. INTRODUCTION 1
    THE DESIGN OF POSTGRES Michael Stonebraker and Lawrence A. Rowe Department of Electrical Engineering and Computer Sciences University of California Berkeley, CA 94720 Abstract This paper presents the preliminary design of a new database management system, called POSTGRES, that is the successor to the INGRES relational database system. The main design goals of the new system are to: 1) provide better support for complex objects, 2) provide user extendibility for data types, operators and access methods, 3) provide facilities for active databases (i.e., alerters and triggers) and inferencing includ- ing forward- and backward-chaining, 4) simplify the DBMS code for crash recovery, 5) produce a design that can take advantage of optical disks, workstations composed of multiple tightly-coupled processors, and custom designed VLSI chips, and 6) make as few changes as possible (preferably none) to the relational model. The paper describes the query language, programming langauge interface, system architecture, query processing strategy, and storage system for the new system. 1. INTRODUCTION The INGRES relational database management system (DBMS) was implemented during 1975-1977 at the Univerisity of California. Since 1978 various prototype extensions have been made to support distributed databases [STON83a], ordered relations [STON83b], abstract data types [STON83c], and QUEL as a data type [STON84a]. In addition, we proposed but never pro- totyped a new application program interface [STON84b]. The University of California version of INGRES has been ``hacked up enough'' to make the inclusion of substantial new function extremely dif®cult. Another problem with continuing to extend the existing system is that many of our proposed ideas would be dif®cult to integrate into that system because of earlier design decisions.
    [Show full text]
  • Ingres II HOWTO Ingres II HOWTO
    Ingres II HOWTO Ingres II HOWTO Table of Contents Ingres II HOWTO ..............................................................................................................................................1 Pal Domokos, pal.domokos@usa.net......................................................................................................1 1.Introduction...........................................................................................................................................1 2.The Ingres Software Development Kit.................................................................................................1 3.System Requirements...........................................................................................................................1 4.Preparing for the Installation................................................................................................................1 5.The Installation Process........................................................................................................................2 6.First Steps.............................................................................................................................................2 7.Basic System and Database Administration.........................................................................................2 8.Web Access...........................................................................................................................................2 9.Miscellaneous Topics............................................................................................................................2
    [Show full text]
  • Ingres 2006 R2 for Openvms RMS Gateway User Guide
    Ingres® 2006 Release 2 for OpenVMS RMS Gateway User Guide ® February 2007 This documentation and related computer software program (hereinafter referred to as the "Documentation") is for the end user's informational purposes only and is subject to change or withdrawal by Ingres Corporation ("Ingres") at any time. This Documentation may not be copied, transferred, reproduced, disclosed or duplicated, in whole or in part, without the prior written consent of Ingres. This Documentation is proprietary information of Ingres and protected by the copyright laws of the United States and international treaties. Notwithstanding the foregoing, licensed users may print a reasonable number of copies of this Documentation for their own internal use, provided that all Ingres copyright notices and legends are affixed to each reproduced copy. Only authorized employees, consultants, or agents of the user who are bound by the confidentiality provisions of the license for the software are permitted to have access to such copies. This right to print copies is limited to the period during which the license for the product remains in full force and effect. The user consents to Ingres obtaining injunctive relief precluding any unauthorized use of the Documentation. Should the license terminate for any reason, it shall be the user's responsibility to return to Ingres the reproduced copies or to certify to Ingres that same have been destroyed. To the extent permitted by applicable law, INGRES PROVIDES THIS DOCUMENTATION "AS IS" WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. IN NO EVENT WILL INGRES BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS DOCUMENTATION, INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF INGRES IS EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE.
    [Show full text]