Re: code question: storing INTO relation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: code question: storing INTO relation
Дата
Msg-id 9640.1098142625@sss.pgh.pa.us
обсуждение исходный текст
Ответ на code question: storing INTO relation  (Neil Conway <neilc@samurai.com>)
Ответы Re: code question: storing INTO relation  (Gavin Sherry <swm@linuxworld.com.au>)
Список pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
> I've got the CREATE TABLE AS restructuring almost finished, but came
> across something that I could use some advice on. The current code
> stores the "into" relation (and whether or not that relation has OIDs)
> in the Query struct. This is ugly[1], but I'm not sure how to fix it.

It strikes me that as far as the executor is concerned, CREATE TABLE AS
would be better treated as an INSERT (ie, pretend it was CREATE TABLE
followed by INSERT/SELECT).  If you did that then the idea would be to
create the new table and add it to the query range table.  Then you need
neither any special-case code in execMain, nor a new DestReceiver.

You'd still want to copy/modify the Query, but to convert it from a
SELECT into an INSERT, which is a pretty clean transformation I think.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: V3 protocol gets out of sync on messages that cause allocation failures
Следующее
От: Gavin Sherry
Дата:
Сообщение: Re: code question: storing INTO relation