public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andrei Matei <[email protected]>
To: Tom Lane <[email protected]>
Cc: [email protected]
Subject: Re: is ErrorResponse possible on Sync?
Date: Wed, 12 Jan 2022 13:18:53 -0500
Message-ID: <CABWLsevei_ZN45esJ7LSSvJ1A2X7vt2ygu9u5jSz4dpD8TaSFw@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CABWLseub08wdSS0V63uK9gazbKLUysXcGizLcBk6+UUz9DpOhw@mail.gmail.com>
	<[email protected]>

Thanks!

I work on CockroachDB - which is wire-compatible with Postgres - so I'm
interested in what the server can and cannot do.


> Uh ... I don't think Sync itself can fail.  Any ErrorResponse you see
> there is really from failure of some prior command.


Hmm, this got me curious. If Sync itself cannot fail, then what is this
sentence really saying: "This parameterless message (ed. Sync) causes the
backend to close the current transaction if it's not inside a BEGIN/COMMIT
transaction block (“close” meaning to commit if no error, or roll back if
error)." ?
This seems to say that, outside of BEGIN/END, the transaction is committed
at Sync time (i.e. if the Sync is never sent, nothing is committed).
Presumably, committing a transaction can fail even if no
previous command/statement failed, right?



>   The Sync is really
> delimiting how much stuff you'd like to skip in case of a failure.
> Basically this is to allow pipelining of commands, with the ability to
> discard later commands if an earlier one fails.
>
> But in any case, no, Sync would not suppress an error message if
> one is needed.
>
>                         regards, tom lane
>


view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: is ErrorResponse possible on Sync?
  In-Reply-To: <CABWLsevei_ZN45esJ7LSSvJ1A2X7vt2ygu9u5jSz4dpD8TaSFw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox