Update FAQ.
authorBruce Momjian
Sun, 14 Oct 2001 23:27:31 +0000 (23:27 +0000)
committerBruce Momjian
Sun, 14 Oct 2001 23:27:31 +0000 (23:27 +0000)
doc/FAQ
doc/src/FAQ/FAQ.html

diff --git a/doc/FAQ b/doc/FAQ
index 334143ce5b26107122c992adbe9c58f1bde03162..02037100457a4a45e20b1122568c132c7468e183 100644 (file)
--- a/doc/FAQ
+++ b/doc/FAQ
@@ -1,7 +1,7 @@
 
                 Frequently Asked Questions (FAQ) for PostgreSQL
                                        
-   Last updated: Sat Oct 13 01:26:55 EDT 2001
+   Last updated: Sun Oct 14 19:27:20 EDT 2001
    
    Current maintainer: Bruce Momjian ([email protected])
    
@@ -826,10 +826,8 @@ BYTEA           bytea           variable-length byte array (null-safe)
    object with the nextval() function before inserting and then insert it
    explicitly. Using the example table in 4.16.1, that might look like
    this in Perl:
-    $sql = "SELECT nextval('person_id_seq')";
-    $newSerialID = ($conn->selectrow_array($sql))[0];
-    INSERT INTO person (id, name) VALUES ($newSerialID, 'Blaise Pascal');
-    $res = $dbh->do($sql);
+    new_id = output of "SELECT nextval('person_id_seq')"
+    INSERT INTO person (id, name) VALUES (new_id, 'Blaise Pascal');
 
    You would then also have the new value stored in $newSerialID for use
    in other queries (e.g., as a foreign key to the person table). Note
@@ -840,9 +838,7 @@ BYTEA           bytea           variable-length byte array (null-safe)
    Alternatively, you could retrieve the assigned SERIAL value with the
    currval() function after it was inserted by default, e.g.,
     INSERT INTO person (name) VALUES ('Blaise Pascal');
-    $res = $conn->do($sql);
-    $sql = "SELECT currval('person_id_seq')";
-    $newSerialID = ($conn->selectrow_array($sql))[0];
+    new_id = output of "SELECT currval('person_id_seq')";
 
    Finally, you could use the OID returned from the INSERT statement to
    look up the default value, though this is probably the least portable
index d3f5da6f8f04112ca143982ef668d292f19eb7a6..efb5724282ed627bb3c18cf2a033ccc1633de0c7 100644 (file)
@@ -12,7 +12,7 @@
   alink="#0000FF">
     

Frequently Asked Questions (FAQ) for PostgreSQL

 
-    

Last updated: Sat Oct 13 01:26:55 EDT 2001

+    

Last updated: Sun Oct 14 19:27:20 EDT 2001

 
     

Current maintainer: Bruce Momjian (

@@ -1050,10 +1050,8 @@ BYTEA           bytea           variable-length byte array (null-safe)
     example table in 4.16.1, that might look like
     this in Perl:

 
-    $sql = "SELECT nextval('person_id_seq')";
-    $newSerialID = ($conn->selectrow_array($sql))[0];
-    INSERT INTO person (id, name) VALUES ($newSerialID, 'Blaise Pascal');
-    $res = $dbh->do($sql);
+    new_id = output of "SELECT nextval('person_id_seq')"
+    INSERT INTO person (id, name) VALUES (new_id, 'Blaise Pascal');
 
     You would then also have the new value stored in
     $newSerialID for use in other queries (e.g., as a
@@ -1068,9 +1066,7 @@ BYTEA           bytea           variable-length byte array (null-safe)
     after it was inserted by default, e.g.,

 
     INSERT INTO person (name) VALUES ('Blaise Pascal');
-    $res = $conn->do($sql);
-    $sql = "SELECT currval('person_id_seq')";
-    $newSerialID = ($conn->selectrow_array($sql))[0];
+    new_id = output of "SELECT currval('person_id_seq')";
 
     Finally, you could use the OID
     returned from the INSERT statement to look up the