Re: [HACKERS] Getting OID in psql of recent insert

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Getting OID in psql of recent insert
Дата
Msg-id 199911210055.TAA20248@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Getting OID in psql of recent insert  (Peter Eisentraut <peter_e@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] New regression driver
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] New regression driver