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