Re: patch: Add columns via CREATE OR REPLACE VIEW
От | Robert Haas |
---|---|
Тема | Re: patch: Add columns via CREATE OR REPLACE VIEW |
Дата | |
Msg-id | 603c8f070808070842h2843a0fdkc283c9c5f773de2b@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: patch: Add columns via CREATE OR REPLACE VIEW (Alvaro Herrera <alvherre@commandprompt.com>) |
Список | pgsql-hackers |
On Thu, Aug 7, 2008 at 11:17 AM, Alvaro Herrera <alvherre@commandprompt.com> wrote: > Robert Haas escribió: >> Here's a patch that allows CREATE OR REPLACE VIEW to add new columns >> to an existing view. >> >> Any feedback would be appreciated, especially if it meant that I could >> fix any problems before the next commitfest. > > What happens with the columns previously defined? What happens if I > specify a different column definition for them; does it raise an error? Yes. CheckViewTupleDesc() errors out, same as before. Basically, the old algorithm was: 1. Check [new # of columns] = [old # of columns] 2. For each column: check that [old definition] = [new definition] The new algorithm is: 1. Check [new # of columns] >= [old # of columns] 2. For each column <= [old # of columns]: check that [old definition] = [new definition] 3. For each column > [old # of columns]: add the new column to the relation (as ALTER TABLE ADD COLUMN, except bypassing the usual prohibition on adding columns to views) ...Robert
В списке pgsql-hackers по дате отправления: