I'm a novice, too, but why not look up the value in the sequence and
increment it before doing any inserting? If you are doing all the inserts
at the same time (more or less), then you can just use this value in the
insert into both tables. Put all of this inside one transaction.
Sean
----- Original Message -----
From: "Oliver Fromme" <olli@lurza.secnetix.de>
To: "Michael Glaesemann" <grzm@myrealbox.com>
Cc: <pgsql-novice@postgresql.org>; "A Gilmore" <agilmore@shaw.ca>
Sent: Monday, August 09, 2004 6:06 AM
Subject: Re: [NOVICE] Design question regarding arrays
>
> Michael Glaesemann wrote:
> > On Aug 9, 2004, at 6:42 PM, Oliver Fromme wrote:
> >
> > > Well, I assume that all your book titles are unique,
> >
> > Realistically, probably not a good assumption. Not one I'd want to bank
> > by db schema on. You might be luckier with something like ISSN, but I
> > don't know enough about re-use of those types of numbers.
>
> My example was a bit simplified for the matter. Probably
> those rows contain more information than just the title,
> but also the author, publisher, date, ISSN/ISBN etc.
> I think it is a reasonable assumption that the whole rows
> (excluding the serial IDs) are unique.
>
> Best regards
> Oliver
>
> --
> Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
> Any opinions expressed in this message may be personal to the author
> and may not necessarily reflect the opinions of secnetix in any way.
>
> "I have stopped reading Stephen King novels.
> Now I just read C code instead."
> -- Richard A. O'Keefe
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>