Re: SQL problem?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: "Charley L(dot) Tiggs" <ctiggs(at)xpressdocs(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: SQL problem?
Date: 2005-08-26 15:09:31
Message-ID: 20050826150931.GA16546@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Please don't top post, it makes it harder to preserve context when replying
to your comments.

On Fri, Aug 26, 2005 at 09:51:49 -0500,
"Charley L. Tiggs" <ctiggs(at)xpressdocs(dot)com> wrote:
> What kind of maintenance problems, if you don't mind my asking?

Because if you change your table definition, applications that use '*'
in queries will get back different data than they did previously.
If you use explicit column lists, only if the listed columns are affected
by a change will applications get back different data.

'*' is OK to use to save some typing when entering queries by hand, but you
shouldn't be using in scripts or applications except in very rare cases.

>
> Charley
>
> On Aug 25, 2005, at 9:21 PM, Bruno Wolff III wrote:
>
> >On Thu, Aug 25, 2005 at 16:47:54 -0700,
> > operationsengineer1(at)yahoo(dot)com wrote:
> >
> >>>Column names are case-sensitive.
> >>>Btw.: SELECT * is evil...
> >>>
> >>>
> >>>
> >>>Regards, Andreas.
> >>>
> >>
> >>Andreas, what would you recommend instead of SELECT *
> >>if you really do wanty all the results?
> >>
> >
> >Explicitly listing the columns. Using '*' causes maintainance
> >problems.

While the context should make this obvious, the first period about shouldn't
have been there.

> >
> >---------------------------(end of
> >broadcast)---------------------------
> >TIP 6: explain analyze is your friend
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Walker, Jed S 2005-08-26 16:02:55 Packet sizes on transfers between client/server
Previous Message Charley L. Tiggs 2005-08-26 14:51:49 Re: SQL problem?