Re: Pipelining executions to postgresql server

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Pipelining executions to postgresql server
Дата
Msg-id 54583241.8030506@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: Pipelining executions to postgresql server  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 11/04/2014 09:10 AM, Tom Lane wrote:
> Mikko Tiihonen <Mikko.Tiihonen@nitorcreations.com> writes:
>> I do not quite grasp why not sending Sync is so important. My proof of concept setup was for queries with autocommit
enabled.
>
> [snip] It'll be very much like
> sending a fixed (predetermined) SQL script to the server using a scripting
> language that lacks any conditionals.

... which is part of why I think the batch interface for JDBC is the
appropriate UI, and the existing support in PgJDBC just needs to be
extended to support returning result sets.

The JDBC driver supports multiple result sets, and a batch execution
looks just like a procedure that returned multiple result sets (or
rather, a mix of result sets, affected rowcounts, and no-info success
messages).

See

http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#addBatch(java.lang.String)

http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#executeBatch()



The docs are admittedly mostly oriented toward DML, but nothing stops us
returning SUCCESS_NO_INFO and a resultset. Or if we choose, returning a
rowcount and resultset.

It'd be worth testing what other drivers do before doing that, but
nothing in the spec:

https://jcp.org/aboutJava/communityprocess/mrel/jsr221/index.html

seems to stop us doing it.

The batch interface doesn't offer any way to set scrollable/editable
resultset options, but we don't want to allow that for batches anyway.


--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: Let's drop two obsolete features which are bear-traps for novices
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [PG-XC] how to pass a value(String) from coordinator node to all data nodes