Re: store multiple rows with the SELECT INTO statement

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: store multiple rows with the SELECT INTO statement
Дата
Msg-id 1378242446.61431.YahooMailNeo@web162903.mail.bf1.yahoo.com
обсуждение исходный текст
Ответ на Re: store multiple rows with the SELECT INTO statement  ("Janek Sendrowski" <janek12@web.de>)
Список pgsql-general
Janek Sendrowski <janek12@web.de> wrote:

> I just can't understabd why it's not possible to store multiple
> columns returning from a dynamic Select statement which is
> executet with EXECUTE into a temporary table.

You can:

CREATE TEMPORARY TABLE AS SELECT ...

http://www.postgresql.org/docs/current/interactive/sql-createtableas. html

As the Notes section says:

| This command is functionally similar to SELECT INTO, but it is
| preferred since it is less likely to be confused with other uses
| of the SELECT INTO syntax. Furthermore, CREATE TABLE AS offers a
| superset of the functionality offered by SELECT INTO.

Also see this:

http://www.postgresql.org/docs/current/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-ASSIGNMENT

| Tip: Note that this interpretation of SELECT with INTO is quite
| different from PostgreSQL's regular SELECT INTO command, wherein
| the INTO target is a newly created table. If you want to create a
| table from a SELECT result inside a PL/pgSQL function, use the
| syntax CREATE TABLE ... AS SELECT.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Martin Renters
Дата:
Сообщение: uuids with btree_gist
Следующее
От: David Johnston
Дата:
Сообщение: Re: ALTER TABLE transaction isolation problem