Re: Saving view turns SELECT * into field list

2018-10-15 Thread Ben Madin
Actually, it's super useful, because if someone adds a salaries column to your staff table, it doesn't automatically appear on the front page of your corporate website... :) Made up example, but if you presume that data security is an important part of data management, it is a livesaver. To get a

Re: Saving view turns SELECT * into field list

2018-10-15 Thread Tom Lane
Ben Uphoff writes: > Why, when I save a simple view like: > SELECT * FROM a_table > …does PostgreSQL turn the * into a field list like: > SELECT field1, field2, field3, field4 FROM a_table > ? Because the SQL standard says we should. There's explicit text in there to the effect that adding colum

Re: Saving view turns SELECT * into field list

2018-10-15 Thread David G. Johnston
On Monday, October 15, 2018, Ben Uphoff wrote: > > Why, when I save a simple view like: > > > > SELECT * FROM a_table > > > > …does PostgreSQL turn the * into a field list like: > > > > SELECT field1, field2, field3, field4 FROM a_table > > > Yes, deeply nesting views is a maintenance concern. I

Saving view turns SELECT * into field list

2018-10-15 Thread Ben Uphoff
Hey team – I’m sure this has come up, but my search engine skills couldn’t find an explanation: Why, when I save a simple view like: SELECT * FROM a_table …does PostgreSQL turn the * into a field list like: SELECT field1, field2, field3, field4 FROM a_table ? This is super-frustrating, as it