On 17/05/2004 11:24 Milos Prudek wrote:
Cmd = "INSERT INTO members ... VALUES (...);"

If you want PostgreSQL to populate your idmember field with the next value from the sequence, you need to specify the keyword DEFAULT as its value or omit it from the INSERT list of coulumns (this assumes you have DEFAULT nextval('members_idmember_seq') defined on the idmember column).


Cmd = "SELECT currval('members_idmember_seq') FROM members LIMIT 1;"

Should be :

Cmd = "SELECT currval('members_idmember_seq');"

Remember that there's no such thing as auto-increment fields in PostgreSQL - they are SEQUENCES.
-- Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for Business |
| Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
     joining column's datatypes do not match

Reply via email to