Re: SQL problem? - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: SQL problem?
Date
Msg-id 20050826150931.GA16546@wolff.to
Whole thread Raw
In response to Re: SQL problem?  ("Charley L. Tiggs" <ctiggs@xpressdocs.com>)
List 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@xpressdocs.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@yahoo.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

pgsql-novice by date:

Previous
From: "Charley L. Tiggs"
Date:
Subject: Re: SQL problem?
Next
From: "Walker, Jed S"
Date:
Subject: Packet sizes on transfers between client/server