Tips for re-using function results within single insert

Поиск
Список
Период
Сортировка
От Chris Gamache
Тема Tips for re-using function results within single insert
Дата
Msg-id 20020920165201.85115.qmail@web13806.mail.yahoo.com
обсуждение исходный текст
Ответы Re: Tips for re-using function results within single insert  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
using this table:
create table test_table (a text, b text);

This would be nice to be able to do...

insert into test_table (a,b) select random()::text as "myrandom",
  encode("myrandom",'base64');


Any ideas on how to accomplish this without

create table test_table (id serial, a text, b text);

insert into test_table (a) values (random()::text);
update test_table set b=encode(a,'base64') where id = currval('id_seq');

CG


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Data Dump Issue
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Monitoring a Query