Обсуждение: v3 protocol question

Поиск
Список
Период
Сортировка

v3 protocol question

От
"Chris Smith"
Дата:
I'm working on batch executes now, and ran into the following interpretation
with the v3 protocol.  Does anyone know off-hand?  Can I issue a series of
multiple Parse/Execute/Bind statements without an intervening Sync?  From
reading the docs, it seems like doing so would be valid, and it would have two
effects:

1. The statements would occur in the same transaction even in autocommit mode.
2. An error somewhere will cause the remainder to be skipped.

Seems like that's exactly what we want to occur if someone submits a string
containing multiple SQL statements as one member of a batch transaction.
However, I'm unclear on whether this is really even possible or not.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation


Re: v3 protocol question

От
Tom Lane
Дата:
"Chris Smith" <cdsmith@twu.net> writes:
> I'm working on batch executes now, and ran into the following interpretation
> with the v3 protocol.  Does anyone know off-hand?  Can I issue a series of
> multiple Parse/Execute/Bind statements without an intervening Sync?

Yup, if you want the later ones to be dropped should an error occur in
the earlier ones.  The (nearly) entire point of Sync is to be the
protocol resynchronization point after an error.

You may or may not need to put in Flush messages instead.  If you want
to inspect any intermediate results before issuing more commands then
you will need to Flush before you block for input.

See also the recent discussion about the possibility of deadlock if you
send too much data without stopping to absorb any input data.  If you
can absorb data but leave it queued for later processing then this
shouldn't be too painful ...

            regards, tom lane