| От | gnari |
|---|---|
| Тема | Re: change natural column order |
| Дата | |
| Msg-id | 014e01c4d746$229d8e50$0100000a@wp2000 обсуждение исходный текст |
| Ответ на | Re: change natural column order ("Dann Corbit" <DCorbit@connx.com>) |
| Список | pgsql-general |
From: "Dann Corbit" <DCorbit@connx.com>
> 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?
> 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
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера