Re: [GENERAL] 8.1, OID's and plpgsql

2005-12-03 Thread Uwe C. Schroeder
the ctid seems to be the solution to my problem. I'm inserting the record in a transaction so the ctid shouldn't change while the transaction isn't finished (either rolled back or committed). One question though. How would I get the ctid of the just inserted record. GET DIAGNOSTICS only handles

Re: [GENERAL] 8.1, OID's and plpgsql

2005-12-02 Thread Jim C. Nasby
On Fri, Dec 02, 2005 at 06:58:39PM -0500, Tom Lane wrote: > "Jim C. Nasby" <[EMAIL PROTECTED]> writes: > > Maybe the docs should be changed to just say that you should never reuse > > a ctid outside of the transaction you obtained the ctid in? > > That's not a sufficient rule either: someone else

Re: [GENERAL] 8.1, OID's and plpgsql

2005-12-02 Thread Jim C. Nasby
On Fri, Dec 02, 2005 at 06:58:39PM -0500, Tom Lane wrote: > "Jim C. Nasby" <[EMAIL PROTECTED]> writes: > > Maybe the docs should be changed to just say that you should never reuse > > a ctid outside of the transaction you obtained the ctid in? > > That's not a sufficient rule either: someone else

Re: [GENERAL] 8.1, OID's and plpgsql

2005-12-02 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > Maybe the docs should be changed to just say that you should never reuse > a ctid outside of the transaction you obtained the ctid in? That's not a sufficient rule either: someone else could still delete or update the row while your transaction runs. Y

Re: [GENERAL] 8.1, OID's and plpgsql

2005-12-02 Thread Jim C. Nasby
On Thu, Dec 01, 2005 at 07:18:10PM -0800, Uwe C. Schroeder wrote: > Why not have something like the rowid in oracle? http://www.postgresql.org/docs/8.1/interactive/datatype-oid.html, search on ctid. And http://www.postgresql.org/docs/8.1/interactive/ddl-system-columns.html. >From the 2nd URL: cti

Re: [GENERAL] 8.1, OID's and plpgsql

2005-12-02 Thread Jaime Casanova
On 12/1/05, Uwe C. Schroeder <[EMAIL PROTECTED]> wrote: > On Thursday 01 December 2005 10:24, Jaime Casanova wrote: > > On 12/1/05, Uwe C. Schroeder <[EMAIL PROTECTED]> wrote: > > > Hi everyone, > > > > > > in 8.1 by default tables have no OID's anymore. Since OID's are 4 byte > > > it's probably a

Re: [GENERAL] 8.1, OID's and plpgsql

2005-12-01 Thread Uwe C. Schroeder
On Thursday 01 December 2005 10:24, Jaime Casanova wrote: > On 12/1/05, Uwe C. Schroeder <[EMAIL PROTECTED]> wrote: > > Hi everyone, > > > > in 8.1 by default tables have no OID's anymore. Since OID's are 4 byte > > it's probably a good idea to discourage the use of them (they produced a > > lot of

Re: [GENERAL] 8.1, OID's and plpgsql

2005-12-01 Thread Martijn van Oosterhout
On Thu, Dec 01, 2005 at 09:01:05AM -0800, Uwe C. Schroeder wrote: > Now there's the issue with stored procs. A usual construct would be to > ... > ... > INSERT xx; > GET DIAGNOSTICS lastoid=RESULT_OID; > SELECT oid=lastoid; > > > > Is there anything one could sanely replace this

Re: [GENERAL] 8.1, OID's and plpgsql

2005-12-01 Thread Jaime Casanova
On 12/1/05, Uwe C. Schroeder <[EMAIL PROTECTED]> wrote: > > Hi everyone, > > in 8.1 by default tables have no OID's anymore. Since OID's are 4 byte it's > probably a good idea to discourage the use of them (they produced a lot of > trouble in the past anyways, particularly with backup/restores etc)

Re: [GENERAL] 8.1, OID's and plpgsql

2005-12-01 Thread Richard Huxton
Uwe C. Schroeder wrote: Hi everyone, in 8.1 by default tables have no OID's anymore. Since OID's are 4 byte it's probably a good idea to discourage the use of them (they produced a lot of trouble in the past anyways, particularly with backup/restores etc) Now there's the issue with stored pr

[GENERAL] 8.1, OID's and plpgsql

2005-12-01 Thread Uwe C. Schroeder
Hi everyone, in 8.1 by default tables have no OID's anymore. Since OID's are 4 byte it's probably a good idea to discourage the use of them (they produced a lot of trouble in the past anyways, particularly with backup/restores etc) Now there's the issue with stored procs. A usual construct wou