Re: Alternative to psql -c ?

Поиск
Список
Период
Сортировка
Искать
От
James Le Cuirot
Тема
Re: Alternative to psql -c ?
Дата
Msg-id
20140627102803.1c036b86@red.yakaraplc.local
Ответ на
Список
Дерево обсуждения
Alternative to psql -c ? James Le Cuirot <chewi@aura-online.co.uk>
Re: Alternative to psql -c ? Christoph Berg <cb@df7cb.de>
Re: Alternative to psql -c ? Jerry Sievers <gsievers19@comcast.net>
Re: Alternative to psql -c ? James Le Cuirot <chewi@aura-online.co.uk>
Re: Alternative to psql -c ? Merlin Moncure <mmoncure@gmail.com>
Re: Alternative to psql -c ? James Le Cuirot <chewi@aura-online.co.uk>
Re: Alternative to psql -c ? Merlin Moncure <mmoncure@gmail.com>
Re: Alternative to psql -c ? James Le Cuirot <chewi@aura-online.co.uk>
Re: Alternative to psql -c ? Merlin Moncure <mmoncure@gmail.com>
On Thu, 26 Jun 2014 15:00:56 -0700
Tom Lane  wrote:

> James Le Cuirot  writes:
> > Tom Lane  wrote:
> >> PG is not capable of executing queries that are not in
> >> transactions, so yes, PQsendQuery will create a single-statement
> >> transaction if you haven't sent BEGIN.  However, there's a huge
> >> difference for the purposes we're discussing here: PQsendQuery
> >> does not allow more than one SQL command in the string.  So most
> >> of this discussion is irrelevant when you're going through that
> >> API.
> 
> > Heh, are you sure? From the docs...
> 
> > "Using PQsendQuery and PQgetResult solves one of PQexec's problems:
> > If a command string contains multiple SQL commands, the results of
> > those commands can be obtained individually."
> 
> Oh, sorry, I was confusing that with the extended-query-mode API
> (PQexecParams).
> 
> Yeah, PQsendQuery is like PQexec for this purpose --- the backend does
> not actually know the difference.

Okay so you're implying that it does the same kind of transaction
wrapping as PQexec, right? But is it considered to be problematic and
deprecated like PQexec or is it safe for multiple statements? Sorry for
the never ending questions. :)

James

В списке pgsql-general по дате отправления
От: Rémi Cura
Дата:
От: Oliver
Дата:
FAQ