Re: trying to learn plpqsql... so please forgive.. - Mailing list pgsql-sql

From Luis Sousa
Subject Re: trying to learn plpqsql... so please forgive..
Date
Msg-id 3DDB5995.7060403@ualg.pt
Whole thread Raw
In response to trying to learn plpqsql... so please forgive..  (Michiel Lange <michiel@minas.demon.nl>)
List pgsql-sql
> When I do an 'INSERT INTO <table> VALUES <row1,row2,row3>'
> and on the table is a serial primary key named p_key.
> As I want this number to be auto-generated, but use it as a 'customer 
> number', I want to create this function to return the value of this 
> insert. 


Try this:

SELECT currval(<sequence name from table>);

Luis Sousa



pgsql-sql by date:

Previous
From: Luis Sousa
Date:
Subject: Re: Problems invoking psql. Help please.
Next
From: Thrasher
Date:
Subject: Date trunc in UTC