From: Neil Conway <neilc@samurai.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Will LaShell <will@lashell.net>
Cc: Hannu Krosing <hannu@tm.ee>
Cc: Christopher Browne <cbbrowne@acm.org>
Cc: pgsql-hackers@postgresql.org
Subject: start of transaction (was: Re: [PERFORM] Help with count(*))
Date: Sun, 16 Nov 2003 18:18:02 -0500
Message-ID: <87n0avaonp.fsf@mailbox.samurai.com> (raw)
In-Reply-To: <26338.1068996163@sss.pgh.pa.us>
References: <200311141251.38786.mallah@trade-india.com>
<m3ad6zkpgj.fsf@wolfe.cbbrowne.com>
<1068831807.2540.44.camel@fuji.krosing.net>
<3FB52FA7.8060508@lashell.net>
<4987.1068842326@sss.pgh.pa.us>
<87isllbcys.fsf@mailbox.samurai.com>
<26338.1068996163@sss.pgh.pa.us>
Tom Lane <tgl@sss.pgh.pa.us> writes:
> That's defensible when the user issued the BEGIN himself. When the
> BEGIN is coming from some interface library's autocommit logic, it's
> a lot less defensible. If you consult the archives, you will find
> actual user complaints about "why is now() returning a very old time?"
> that we traced to use of interface layers that handle "commit()" by
> issuing "COMMIT; BEGIN;".
Hmmm... I agree this behavior isn't ideal, although I can see the case
for viewing this as a mistake by the application developer: they are
assuming that they know exactly when transactions begin, which is not
a feature provided by their language interface. They should be using
current_timestamp, and/or changing their language interface's
configuration.
That said, I think this is a minor irritation at best. The dual
drawbacks of breaking backward compatibility and making the BEGIN
semantics more confusing is enough to leave me satisfies with the
status quo.
If we do change this, I think Dennis' idea of making now() always
return the same value within a given transaction is interesting: that
might be a way to fix this problem without confusing the semantics of
BEGIN.
-Neil
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: pgsql-performance@postgresql.org
Cc: neilc@samurai.com, tgl@sss.pgh.pa.us, will@lashell.net, hannu@tm.ee, cbbrowne@acm.org, pgsql-hackers@postgresql.org
Subject: Re: start of transaction (was: Re: [PERFORM] Help with count(*))
In-Reply-To: <87n0avaonp.fsf@mailbox.samurai.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox