Re: moving from mySQL to pgsql, need a bit of help (perl)
В списке pgsql-general по дате отправления:
| От | Peter Haworth |
|---|---|
| Тема | Re: moving from mySQL to pgsql, need a bit of help (perl) |
| Дата | |
| Msg-id | ML-3.4.963318699.886.pmh@edison.ioppublishing.com обсуждение исходный текст |
| Ответ на | Re: moving from mySQL to pgsql, need a bit of help (perl) (Ed Loehr <eloehr@austin.rr.com>) |
| Список | pgsql-general |
Ed Loehrwrote:
> I believe DBI/DBD does this for you:
>
> while ($row_href = $sth->fetchrow_hashref)
> {
> push( @taghash, $row_href);
> }
Don't do that! Each hashref in that array will point to the same hash in some
future version of the DBI. You should do this instead:
while($row=$sth->fetchrow_hashref){
push @taghash,{%$row};
}
Or, better yet:
$taghash=$sth->fetchall_arrayref({});
to get everything all in one go.
--
Peter Haworth pmh@edison.ioppublishing.com
"Master, does Emacs have the Buddha nature?" the novice asked.
The Chief Priest had been in the temple for many years and could be
relied upon to know these things. He thought for several minutes before
replying, "I don't see why not. It's got bloody well everything else."
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера