> > > create sequence mysequence;
> > >
> > > create table foo(
> > > id integer default nextval('mysequence'),
> > > bla text,
> > > wombat integer,
> > > foobar date,
> > > primary key(id)
> > > );
> > >
> > > insert into foo (wombat) values (88);
> > >
> > > now how do i know the id
On Fri, 19 Nov 2004 10:57:12 -0500
"Passynkov, Vadim" <[EMAIL PROTECTED]> wrote:
> > -Original Message-
> > From: Erik Thiele [mailto:[EMAIL PROTECTED]
> > Sent: Friday, November 19, 2004 3:42 AM
> > To: [EMAIL PROTECTED]
> > Subje
> -Original Message-
> From: Erik Thiele [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 19, 2004 3:42 AM
> To: [EMAIL PROTECTED]
> Subject: [SQL] get sequence value of insert command
>
>
> hi
>
> create sequence mysequence;
>
> create table
I seem to recall it was mine. I made the mistake of assuming it wasn't
concurrency safe and was gently corrected by one of the community. I
think it might have been a Tim/Tam Lane. Wonder what happened to him? :-)
M tim tams
rgds
Homer
---(end of broadcast)
On Nov 19, 2004, at 5:41 PM, Erik Thiele wrote:
now how do i know the id of my newly inserted element? and
how can this be done in a completely concurrency safe way?
This is a FAQ (4.15.1, among others). See currval() and nextval() in
the documentation as well.
Michael Glaesemann
grzm myrealbox c
Achilleus Mantzios wrote:
now how do i know the id of my newly inserted element? and
how can this be done in a completely concurrency safe way?
The way to do this is by reading the docs :)
use currval, it is session safe.
The increase in this question suggests the number of new users has
increase
O Erik Thiele έγραψε στις Nov 19, 2004 :
> hi
>
> create sequence mysequence;
>
> create table foo(
> id integer default nextval('mysequence'),
> bla text,
> wombat integer,
> foobar date,
> primary key(id)
> );
>
> insert into foo (wombat) values (88);
>
> now how do i know the id o
hi
create sequence mysequence;
create table foo(
id integer default nextval('mysequence'),
bla text,
wombat integer,
foobar date,
primary key(id)
);
insert into foo (wombat) values (88);
now how do i know the id of my newly inserted element? and
how can this be done in a completely co