Hi Gaetano, Postgresql implements serial field using sequences.
detailed description of sequences are avaliable at http://www.postgresql.org/idocs/index.php?functions-sequence.html a NICE flash tutorial is also available at: http://techdocs.postgresql.org/college/001_sequences/ the specific answer to your question is the function "currval(sequence_name)" can be used. you can get the name of sequenced being used for the serial field by describing the table (\d tablename). But the very idea of inserting the value and then retriving the sequence number sounds fishy to me. Why not get the sequence number first and than insert using that seqnce number (more on the flash tutorial ). regds mallah. On Monday 06 May 2002 04:16 pm, Gaetano Mendola wrote: > Hi all, > > having a table with a serial field what is the corrected method > to retrieve the value after an insert ? > > > > > Ciao > Gaetano -- Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(11)6152172 (221) (L) ,9811255597 (M) Visit http://www.trade-india.com , India's Leading B2B eMarketplace. ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])