Re: Practical question.

From: louis gonzales <gonzales(at)linuxlouis(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Practical question.
Date: 2007-03-16 04:22:56
Message-ID: 45FA1BA0.6060606@linuxlouis.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

:) , something that is analogous to a race condition. is this something
I shouldn't be concerned with?
I suppose if I knew for certain there was some kind of synchronous
behavior, then I wouldn't fear a potentially subsequent event completing
before the previous one doing so.

As a possible solution, I'm thinking that I can make the trigger be a
before trigger, where the before trigger captures the 'nextvalue' for
both the actual insert and the table creation would be based on this,
while incrementing the sequence to guarantee that each successive pull
on the nextvalue will have the correct one.

Does that sound plausible?

Thanks,

Tom Lane wrote:

>louis gonzales <gonzales(at)linuxlouis(dot)net> writes:
>
>
>>As an example:
>>insertX which initiates the trigger reads the 'nextvalue' from the
>>sequence and begins to create the associcated table
>>insertY happens almost at the same time, so that it gets the same
>>'nextvalue' from the sequence
>>
>>
>
>[ blink... ] Whatever makes you think that could happen?
>
> regards, tom lane
>
>

--
Email: louis(dot)gonzales(at)linuxlouis(dot)net
WebSite: http://www.linuxlouis.net
"Open the pod bay doors HAL!" -2001: A Space Odyssey
"Good morning starshine, the Earth says hello." -Willy Wonka

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2007-03-16 04:25:20 Re: Practical question.
Previous Message Tom Lane 2007-03-16 04:12:57 Re: Practical question.