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 wrote: > On May 6, 2010, at 4:29 PM, Merlin Moncure wrote: >> On Thu, May 6, 2010 at 3:23 PM, Andrew Dunstan wrote: >>> And many places regard "select *" in anything other than throw-away queries >>> as bad practice anyway. I have seen people get bitten

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 wrote: > On May 6, 2010, at 4:29 PM, Merlin Moncure wrote: >> On Thu, May 6, 2010 at 3:23 PM, Andrew Dunstan wrote: >>> And many places regard "select *" in anything other than throw-away queries >>> as bad practice anyway. I have seen people get bitten

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 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 compa

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 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 > coding stand

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 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 bad practice anyway. I ha

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 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 you absolutely require t

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

2010-05-06 Thread Tom Lane
Joseph Adams 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 your subscription: http://ww

[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 f