Re: Sending several commands simultaneously to PostgreSQL 8.4
От | Alexander Farber |
---|---|
Тема | Re: Sending several commands simultaneously to PostgreSQL 8.4 |
Дата | |
Msg-id | CAADeyWj4BCtmoQVz1o0VD2JSG-BEdzFZrMFp1qmnY-btOz0UfA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Sending several commands simultaneously to PostgreSQL 8.4 (Alexander Farber <alexander.farber@gmail.com>) |
Список | pgsql-general |
I've ended up calling this procedure in the loop before poll() - to run queued commands from an array of hashes: sub execSql { eval { my $dbh = DBI->connect_cached(DSN, DBUSER, DBPASS, { private_key => __FILE__, AutoCommit => 1, PrintWarn => 1, PrintError => 1, RaiseError => 1, FetchHashKeyName => 'NAME_lc', pg_enable_utf8 => 1 }); if ($WaitSql && $dbh->pg_ready) { $WaitSql = 0; $dbh->pg_result(); } if (!$WaitSql && @Sqls) { $WaitSql = 1; my $sql = shift @Sqls; my $cmd = $sql->{CMD}; my $args = $sql->{ARGS}; my $sth = $dbh->prepare_cached($cmd, { pg_async => PG_ASYNC + PG_OLDQUERY_WAIT }); $sth->execute(@$args); } }; warn $@ if $@; }
В списке pgsql-general по дате отправления: