Re: change natural column order - Mailing list pgsql-general

From Dann Corbit
Subject Re: change natural column order
Date
Msg-id D425483C2C5C9F49B5B7A41F894415470556C2@postal.corporate.connx.com
Whole thread Raw
In response to change natural column order  ("Joolz" <joolz@arbodienst-limburg.nl>)
List pgsql-general

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of gnari
Sent: Tuesday, November 30, 2004 4:48 PM
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] change natural column order

From: "Steve Atkins" <steve@blighty.com>
>
> Would you care to expand on why you think this...
>
>   my $row = $dbh->selectrow_hashref("select * from $table");
>   print 'foo = ', $row{'foo'};
>
> ...is inherently a a code defect?

because it does not work ? (you mean $row->{'foo'})

sorry, could not resist :-)
>>
There is an exception to every rule.  If you need a hash for the whole
row, then you need all the columns.

And while we are at it:
$dbh->selectrow_hashref("SELECT * FROM $table LIMIT 1");
Or something along those lines would be a bit less absurd.
To do a table scan to select a single value is criminal.

"SELECT *" is a horrible disease, coughed up by those who do not know
what they want most of the time.
<<

pgsql-general by date:

Previous
From: "gnari"
Date:
Subject: Re: Trigger Problems
Next
From: "gnari"
Date:
Subject: Re: change natural column order