Alternative to temp tables?

Поиск
Список
Период
Сортировка
От Postgres User
Тема Alternative to temp tables?
Дата
Msg-id b88c3460909112351m60b7782bod7fdd5d00e79505@mail.gmail.com
обсуждение исходный текст
Ответы Re: Alternative to temp tables?  (Scott Marlowe <scott.marlowe@gmail.com>)
Список pgsql-general
Hi,

I have a simple function that returns a set of rows:

CREATE OR REPLACE FUNCTION foo()
  RETURNS SETOF record AS
$$
BEGIN
    RETURN QUERY SELECT * FROM people WHERE last_name = 'jones';
END
$$
LANGUAGE 'plpgsql'

In a separate function, I call the function and store the results in a
temp table using this syntax:

INSERT INTO tmp_tbl SELECT * FROM foo()


This works, but I'd like to know if there's another way to hold the
results.  Can I get the results from foo() and store those in a local
var such as

recs record[]   OR
recs people[]

Or are temp tables the only way to hold table-based results?

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

Предыдущее
От: "Vikram Patil"
Дата:
Сообщение: Regarding initdb & pg_ctl
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Alternative to temp tables?