Re: Newbie question: returning rowtypes from a plpgsql function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Newbie question: returning rowtypes from a plpgsql function
Дата
Msg-id 7928.1101913551@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Newbie question: returning rowtypes from a plpgsql function  (Larry White <ljw1001@gmail.com>)
Список pgsql-general
Larry White <ljw1001@gmail.com> writes:
> mysql> create table t as ( select * from table_x);

That works in Postgres too.  The SELECT INTO construct is a bit broken
since, as you discovered, it has a different meaning in plpgsql than
in the main SQL language.  So I recommend using CREATE TABLE AS when
you want to create a table this way.

> The declarations section of the pl/pgsql documentation doesn't explain
> how to declare a variable to represent a set of rows

You can't.  Possibly a cursor would help?

            regards, tom lane

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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: [HACKERS] Adding Reply-To: to Lists configuration ...
Следующее
От: "Riccardo G. Facchini"
Дата:
Сообщение: Re: [PERFORM] pg_restore taking 4 hours!