Re: [HACKERS] SELECT * in a CREATE VIEW statement doesn't update column set automatically

2010-05-17 Thread Jim Nasby
On May 6, 2010, at 4:29 PM, Merlin Moncure wrote: On Thu, May 6, 2010 at 3:23 PM, Andrew Dunstan and...@dunslane.net wrote: And many places regard select * in anything other than throw-away queries as bad practice anyway. I have seen people get bitten by it over and over again, and I have

Re: [HACKERS] SELECT * in a CREATE VIEW statement doesn't update column set automatically

2010-05-17 Thread Merlin Moncure
On Mon, May 17, 2010 at 2:15 PM, Jim Nasby deci...@decibel.org wrote: On May 6, 2010, at 4:29 PM, Merlin Moncure wrote: On Thu, May 6, 2010 at 3:23 PM, Andrew Dunstan and...@dunslane.net wrote: And many places regard select * in anything other than throw-away queries as bad practice anyway. I

Re: [HACKERS] SELECT * in a CREATE VIEW statement doesn't update column set automatically

2010-05-17 Thread Merlin Moncure
On Mon, May 17, 2010 at 2:15 PM, Jim Nasby deci...@decibel.org wrote: On May 6, 2010, at 4:29 PM, Merlin Moncure wrote: On Thu, May 6, 2010 at 3:23 PM, Andrew Dunstan and...@dunslane.net wrote: And many places regard select * in anything other than throw-away queries as bad practice anyway. I

[HACKERS] SELECT * in a CREATE VIEW statement doesn't update column set automatically

2010-05-06 Thread Joseph Adams
This isn't exactly a bug, but it could be considered unintuitive behavior. Consider this: CREATE VIEW foo AS SELECT * FROM a; CREATE VIEW foo_v AS SELECT * FROM foo; ALTER TABLE foo ADD COLUMN b INT; The ALTER TABLE statement affects VIEW foo, but the column addition does not propagate to VIEW

Re: [HACKERS] SELECT * in a CREATE VIEW statement doesn't update column set automatically

2010-05-06 Thread Tom Lane
Joseph Adams joeyadams3.14...@gmail.com writes: This isn't exactly a bug, but it could be considered unintuitive behavior. It's required by the SQL standard. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to

Re: [HACKERS] SELECT * in a CREATE VIEW statement doesn't update column set automatically

2010-05-06 Thread Merlin Moncure
On Thu, May 6, 2010 at 3:01 PM, Joseph Adams joeyadams3.14...@gmail.com wrote: This isn't exactly a bug, but it could be considered unintuitive behavior.  Consider this: by unintuitive you mean: 'explicitly defined in the SQL standard' :-). I happen to agree with you but that's irrelevant. If

Re: [HACKERS] SELECT * in a CREATE VIEW statement doesn't update column set automatically

2010-05-06 Thread Andrew Dunstan
Tom Lane wrote: Joseph Adams joeyadams3.14...@gmail.com writes: This isn't exactly a bug, but it could be considered unintuitive behavior. It's required by the SQL standard. And many places regard select * in anything other than throw-away queries as

Re: [HACKERS] SELECT * in a CREATE VIEW statement doesn't update column set automatically

2010-05-06 Thread Merlin Moncure
On Thu, May 6, 2010 at 3:23 PM, Andrew Dunstan and...@dunslane.net wrote: And many places regard select * in anything other than throw-away queries as bad practice anyway. I have seen people get bitten by it over and over again, and I have worked at companies where it is explicitly forbidden in