Re: prepare, execute & oids

From: Chris <dmagick(at)gmail(dot)com>
To: phazon <phazon(dot)ml(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: prepare, execute & oids
Date: 2006-08-02 07:45:57
Message-ID: 44D05835.5010306@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

phazon wrote:
> I use PHP.
> When I make juste a simple insert like
>
> Insert Into my_table (my_field) values ('value')
>
> I get back the OID of the inserted line.
>
> But when i use the prepareInsert fonction, I get nothing back. That's a
> pprobleme becaus i need to take the primary key of the line inserted in
> order to make post-operations.
>
> I can't use the curval of a sequence because it can be the value of
> another insert made by another user.

currval is transaction safe, it's not a problem you need to worry about.

http://www.postgresql.org/docs/8.1/static/functions-sequence.html

--
Postgresql & php tutorials
http://www.designmagick.com/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Christian Rengstl 2006-08-02 07:46:04 Re: Strange error message
Previous Message Christian Rengstl 2006-08-02 07:44:54 Re: Strange error message