| From: | Yasir Malik <ymalik(at)cs(dot)stevens-tech(dot)edu> |
|---|---|
| To: | Greg Stark <gsstark(at)mit(dot)edu> |
| Cc: | Guillaume LELARGE <gleu(at)wanadoo(dot)fr>, pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: Getting last insert value |
| Date: | 2003-11-15 20:11:04 |
| Message-ID: | Pine.SGI.4.58.0311151510140.80813@guinness.cs.stevens-tech.edu |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
Thank you all for your help.
Yasir Malik
On Sat, 15 Nov 2003, Greg Stark wrote:
> Date: 15 Nov 2003 12:50:28 -0500
> From: Greg Stark <gsstark(at)mit(dot)edu>
> To: Guillaume LELARGE <gleu(at)wanadoo(dot)fr>
> Cc: Yasir Malik <ymalik(at)cs(dot)stevens-tech(dot)edu>, pgsql-sql(at)postgresql(dot)org
> Subject: Re: [SQL] Getting last insert value
>
>
> Guillaume LELARGE <gleu(at)wanadoo(dot)fr> writes:
>
> > Doing a "select currval() from my_table" after your insert should work.
>
> That's "select currval('my_table_pkcol_seq')" actually.
>
> The above would have called the currval() function for every record of the
> table which isn't what you want and in any case currval takes an argument.
>
> --
> greg
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Theodore Petrosky | 2003-11-15 20:54:03 | Re: Getting last insert value |
| Previous Message | ow | 2003-11-15 19:08:25 | Re: Programatically switching database |