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

From Bruce Momjian
Subject Re: [HACKERS] Getting OID in psql of recent insert
Date
Msg-id 199911210055.TAA20248@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Getting OID in psql of recent insert  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
[Charset ISO-8859-1 unsupported, filtering to ASCII...]
> On 1999-11-18, Tom Lane mentioned:
> 
> > It'd certainly be easy enough for psql to save off the OID anytime it
> > gets an "INSERT nnn" command response.  The missing link is to invent
> > a way for a psql script to access that value and insert it into
> > subsequent SQL commands.
> 
> Okay, I guess I'm way ahead of everyone here. It is in fact only a matter
> of adding a few lines to save the oid in a variable, and all the
> infrastructure for doing this is already present. In fact, I was going to
> do this in the next few days.
> 
> testdb=> \set singlestep on
> testdb=> \set sql_interpol '#'
> testdb=> \set foo 'pg_class'
> testdb=> select * from #foo#;
> ***(Single step mode: Verify query)**************
> QUERY: select * from pg_class
> ***(press return to proceed or enter x and return to
> cancel)********************
> x
> testdb=>

This is exactly what I was hoping you would say.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] New regression driver
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] New regression driver