On Wed, 2006-10-04 at 13:02, Aaron Bono wrote:
> On 10/4/06, Daryl Richter <daryl@eddl.us> wrote:
> On 10/4/06 12:20 PM, "Aaron Bono" <postgresql@aranya.com>
> wrote:
> >
> > So do it as needed and convert your application slowly.
> >
> > I just name my views as table_name_vw so all you have to do
> is modify your
> > queries to hit the _vw instead of just the table. That
> shouldn't take much
> > time to refactor.
>
>
> I wasn't condoning using select * in your application - if an
> application is riddled with that, it is time to start fixing the
> problem because it WILL bite you eventually. I never let my team put
> select * in any queries that end up in the application code - bad
> stuff that!
>
> Of course sometimes, especially when you are doing quick throw away
> queries, select * is nice and controlling the order is handy. It is
> also beneficial when using a generic database tool which will almost
> definitely do a select *.
Actually, the one time I've written an application with select * in it
was when I wrote some simple, generic app that used select * to root out
the layout of the table and make a simple edit screen for any generic
table in postgresql. It used select * from table limit 1 to get the
layout, and using libpq was able to find the type of each field and
thereby produce a proper update / insert query.
But any REAL application should never do that, I agree.