Postgresql 7.1 Programmer's Guide
Total Page:16
File Type:pdf, Size:1020Kb
PostgreSQL 7.1 Programmer's Guide The PostgreSQL Global Development Group PostgreSQL 7.1 Programmer's Guide by The PostgreSQL Global Development Group Copyright © 1996-2001 by PostgreSQL Global Development Group Legal Notice PostgreSQL is Copyright © 1996-2001 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 PROVIDED HEREUNDER IS ON AN "AS-IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTAINANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. Table of Contents Table of Contents . i List of Tables . ii List of Figures . iii List of Examples . iv Preface . i 1. What is PostgreSQL? . i 2. A Short History of Postgres . i 3. Documentation Resources. iii 4. Terminology and Notation . v 5. Bug Reporting Guidelines. v 6. Y2K Statement. viii Organization . x Chapter 1. libpq - C Library . 1 1.1. Database Connection Functions . 1 1.2. Query Execution Functions . 7 1.3. Asynchronous Query Processing . 11 1.4. Fast Path . 14 1.5. Asynchronous Notification. 14 1.6. Functions Associated with the COPY Command. 15 1.7. libpq Tracing Functions . 17 1.8. libpq Control Functions . 17 1.9. Environment Variables . 18 1.10. Threading Behavior . 19 1.11. Example Programs . 19 Chapter 2. Large Objects . 28 2.1. Historical Note . 28 2.2. Implementation Features . 28 2.3. Interfaces . 28 2.4. Built in registered functions. 30 2.5. Accessing Large Objects from LIBPQ . 31 2.6. Sample Program . 31 Chapter 3. libpq++ - C++ Binding Library. 37 3.1. Control and Initialization. 37 3.2. libpq++ Classes . 38 3.3. Database Connection Functions . 38 3.4. Query Execution Functions . 39 3.5. Asynchronous Notification. 43 3.6. Functions Associated with the COPY Command. 43 Chapter 4. pgtcl - TCL Binding Library. 45 4.1. Commands. 45 4.2. Examples . 46 4.3. pgtcl Command Reference Information . 47 pg_connect . 47 pg_disconnect . 48 pg_conndefaults . 49 pg_exec . 50 pg_result . 51 pg_select . 53 i pg_listen . 54 pg_lo_creat . 55 pg_lo_open . 56 pg_lo_close . 57 pg_lo_read . 57 pg_lo_write . ..