From: Gavin Kistner Date: 2004-02-25T07:59:52+09:00 Subject: PGresult#type (and other postgres questions) I'm putting RDoc documents into postgres.c, and I have a few questions about what various methods do. PGresult#type( fieldIndex ) What does the number that is returned correspond to? (Looks like integer/serial is 23, varchar(50) is 1043, smallint is 21 .... where is there a lookup of constants for these values?) PGconn.escape() PGconn.escape_bytea( ... ) What do these two class methods do? (They're not documented in the supplied documentation. Neither is PGconn.quote either, but I figured that one out.) PGconn#insert_table( table, values ) What is 'table'? The supplied documentation merely says Inserts contents of the array into the table. My guess (from playing around) is that 'table' is a String with the name of the table, and 'values' must be an Array of tuples (array of arrays). Is this correct? Also, is there any way to use this method to insert values into a table where one column is of type 'serial'? You can explicitly shove an integer in, but doing so does not cause the serial value to auto-increment...a future call to insert a value in the table which doesn't specify a value for the serial column may choose an existing value, and error. PGconn#notifies() What does this method do? (Not in the supplied documentation.) PGconn#status() What does this method do? (Not in the supplied documentation.) PGresult#cmdtuples() What does this method do? (Not in the supplied documentation.) res = conn.exec('select * from t_lists;') puts res.result.length => 5 puts res.cmdtuples => 0 (More to come as a followup, likely :) -- (-, /\ \/ / /\/