Re: [HACKERS] CREATE OR REPLACE VIEW bug

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: [HACKERS] CREATE OR REPLACE VIEW bug
Дата
Msg-id CAEZATCU+MtAc=OHKP3s3r-abK9gV8VM=4uE+8ZtiuTnb--V7RA@mail.gmail.com
обсуждение исходный текст
Ответ на [HACKERS] CREATE OR REPLACE VIEW bug  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Ответы Re: [HACKERS] CREATE OR REPLACE VIEW bug  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 17 December 2016 at 15:42, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
> It seems that there is a bug in CREATE OR REPLACE VIEW...
>
> DefineView()/DefineVirtualRelation() will need a little re-jigging to
> do things in the required order.

...and the required order for existing views is

1. Add any new columns
2. Add rules to store the new query
3. Update the view options

because 2 will fail if the view's columns don't match the query's columns.

Attached is a patch enforcing this order and adding some comments to
make it clear why the order matters here.

Barring objections I'll back-patch this to 9.4 where WCO was added.

Regards,
Dean

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: pg_authid.rolpassword format (was Re: [HACKERS] Passwordidentifiers, protocol aging and SCRAM protocol)
Следующее
От: Corey Huinker
Дата:
Сообщение: Re: [HACKERS] PSQL commands: \quit_if, \quit_unless