Re: i have table

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Aaron Bono <postgresql(at)aranya(dot)com>
Cc: Daryl Richter <daryl(at)eddl(dot)us>, pgsql-sql(at)postgresql(dot)org
Subject: Re: i have table
Date: 2006-10-04 20:11:12
Message-ID: 1159992672.3800.26.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, 2006-10-04 at 13:02, Aaron Bono wrote:
> On 10/4/06, Daryl Richter <daryl(at)eddl(dot)us> wrote:
> On 10/4/06 12:20 PM, "Aaron Bono" <postgresql(at)aranya(dot)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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message operationsengineer1 2006-10-05 01:23:35 Re: i have table
Previous Message Hector Villarreal 2006-10-04 18:04:56 Re: Assigning a timestamp without timezone to a timestamp