Re: Using oids

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Using oids
Date: 2003-09-03 13:03:55
Message-ID: 1062594234.10618.21.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Wed, 2003-09-03 at 12:19, Martijn van Oosterhout wrote:
> If I were doing it would extract the primary key of each table on startup
> and then change that one line of code to:
>
> os << "SELECT * FROM " << sTable << " WHERE "
> << prikey << " = currval('" << sTable << "_" << prikey << "_seq')";

You cannot use currval() until you have used nextval() on the same
sequence in the same session.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"And he said unto his disciples, Therefore I say unto
you, Take no thought for your life, what ye shall eat;
neither for the body, what ye shall put on. For life
is more than meat, and the body is more than clothing.
Consider the ravens, for they neither sow nor reap;
they have neither storehouse nor barn; and yet God
feeds them; how much better you are than the birds!
Consider the lilies, how they grow; they toil
not, they spin not; and yet I say unto you, that
Solomon in all his glory was not arrayed like one of
these. If then God so clothe the grass, which is to
day in the field, and tomorrow is cast into the oven;
how much more will he clothe you, O ye of little
faith? And seek not what ye shall eat, or what ye
shall drink, neither be ye of doubtful mind.
But rather seek ye the kingdom of God; and all these
things shall be added unto you."
Luke 12:22-24; 27-29; 31.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paul Thomas 2003-09-03 13:34:03 Re: Tomcat Connection Pool?
Previous Message Amin Schoeib 2003-09-03 13:02:34 Trunc in Postgres

Browse pgsql-hackers by date

  From Date Subject
Next Message Samuel A Horwitz 2003-09-03 13:54:34 Re: elog.c comiple problem on AIX 4.2.1
Previous Message Bo Lorentsen 2003-09-03 11:47:01 Re: Using oids