RE: Re: Unanswered questions about Postgre - Mailing list pgsql-general

From Edward Q. Bridges
Subject RE: Re: Unanswered questions about Postgre
Date
Msg-id 200012121657.eBCGvem05954@mail.postgresql.org
Whole thread Raw
In response to RE: Re: Unanswered questions about Postgre  (Roger Wernersson <roger.wernersson@mindark.com>)
List pgsql-general
On Tue, 12 Dec 2000 12:04:46 +0100, Roger Wernersson wrote:

>
> I can't BEGIN - SELECT FOR UPDATE - INSERT or UPDATE - COMMIT as someone
> might insert after my SELECT and before my INSERT.
>

correct me if i'm wrong, but a select for update locks the table for
an insert or an update until the end of the transaction.

--e--



> Is there a right solution?
>
> /Roger
>
> -----Original Message-----
> From: Tim Kientzle [mailto:kientzle@acm.org]
> Sent: den 12 december 2000 02:10
> To: PostgreSQL general mailing list
> Subject: [GENERAL] Re: Unanswered questions about Postgre
>
>
> > Of course, people really shouldn't be inserting
> > objects which already exist, ...
>
> On the contrary, the best way to test if
> something already exists is to just try the
> INSERT and let the database tell you if
> it's already there.  Both faster and more
> reliable than doing SELECT then INSERT.
>
>             - Tim
>




pgsql-general by date:

Previous
From: Chris Jones
Date:
Subject: Re: No postgres on Solaris
Next
From: Vince Vielhaber
Date:
Subject: Re: manuals