From: | "Dann Corbit" <DCorbit(at)connx(dot)com> |
---|---|
To: | "gnari" <gnari(at)simnet(dot)is>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: change natural column order |
Date: | 2004-12-01 01:17:55 |
Message-ID: | D425483C2C5C9F49B5B7A41F894415470556C2@postal.corporate.connx.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of gnari
Sent: Tuesday, November 30, 2004 4:48 PM
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] change natural column order
From: "Steve Atkins" <steve(at)blighty(dot)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.
<<
From | Date | Subject | |
---|---|---|---|
Next Message | gnari | 2004-12-01 01:36:10 | Re: change natural column order |
Previous Message | gnari | 2004-12-01 00:55:39 | Re: Trigger Problems |