Re: change natural column order

From: "gnari" <gnari(at)simnet(dot)is>
To: "Dann Corbit" <DCorbit(at)connx(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: change natural column order
Date: 2004-12-01 01:36:10
Message-ID: 014e01c4d746$229d8e50$0100000a@wp2000
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

From: "Dann Corbit" <DCorbit(at)connx(dot)com>

> 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?

> There is an exception to every rule. If you need a hash for the whole
> row, then you need all the columns.

I think the point was that when the language/libs allow for
easy reading of a row into a hash, it becomes the most
natural and least error prone way. If you add or rename a column,
there are fewer places in the code you need to change.

gnari

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joel 2004-12-01 01:45:51 Re: USENET vs Mailing Lists Poll ...
Previous Message Dann Corbit 2004-12-01 01:17:55 Re: change natural column order