AW: AW: [HACKERS] Getting OID in psql of recent insert - Mailing list pgsql-hackers

From Zeugswetter Andreas SEV
Subject AW: AW: [HACKERS] Getting OID in psql of recent insert
Date
Msg-id 219F68D65015D011A8E000006F8590C603FDC183@sdexcsrv1.f000.d0188.sd.spardat.at
Whole thread Raw
Responses RE: AW: [HACKERS] Getting OID in psql of recent insert
Re: AW: AW: [HACKERS] Getting OID in psql of recent insert
List pgsql-hackers
> >> Yes, I use 'em the same way.  I think an OID is kind of 
> like a pointer
> >> in a C program: good for fast, unique access to an object 
> within the
> >> context of the execution of a particular application (and maybe not
> >> even that long).  You don't write pointers into files to 
> be used again
> >> by other programs, though, and in the same way an OID isn't a good
> >> candidate for a long-lasting reference from one table to another.
> 
> > I thought this special case is where the new xid access 
> method would come
> > in.
> 
> Good point, but (AFAIK) you could only use it for tables that you were
> sure no other client was updating in parallel.  Otherwise you might be
> updating a just-obsoleted tuple.  Or is there a solution for that?

Ok, the fact, that the row changed is known, because we can check the 
snapshot. We also know, that the new row must be near the physical end 
of the table, so maybe we could do a backward scan ?
Maybe we could also simply bail out, like Oracle with a "snapshot too old" 
error message  ?
(I know that this is not the same situation as the stated Oracle error)

> 
> > Is someone still working on the xid access ?
> 
> I think we have the ability to refer to CTID in WHERE now, 

Do we use the sql syntax 'where rowid = :xxx' for it, 
or do we say 'where ctid = :xxx'.
I would like the rowid naming, because Informix, Oracle (and DB/2 ?) use it.

> but not yet an access method that actually makes it fast...

Well that is of course only half the fun :-(
Could it be done like an index access, 
where the first part of the work is skipped, or tunneled through ?

Andreas


pgsql-hackers by date:

Previous
From: Michael Meskes
Date:
Subject: Float/Numeric?
Next
From: SAKAIDA Masaaki
Date:
Subject: Re: [HACKERS] Getting OID in psql of recent insert