pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Pavan Deolasee <pavan.deolasee@gmail.com>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: Pavan Deolasee <pavan.deolasee@2ndquadrant.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] MERGE SQL Statement for PG11
Date: Sat, 10 Feb 2018 02:49:01 +0100
Message-ID: <0bd07f01-8c0e-1205-df90-a9ae77dafa5b@2ndquadrant.com> (raw )
In-Reply-To: <CABOikdPjjG+JcdNeegrL7=BtPdJ6yEv--V4hU8KzJTTwX1SNmw@mail.gmail.com >
References: <CANP8+jKitBSrB7oTgT9CY2i1ObfOt36z0XMraQc+Xrz8QB0nXA@mail.gmail.com >
<CA+TgmoavFdPbCeB+QUSdeQieW2rhCdR54qndO_8irHOXrCjxUg@mail.gmail.com >
<CANP8+jLzhsmvL7fVgikCUR-ZhUCZ3JnMCGjgS49uTsCzvuNCBw@mail.gmail.com >
<CAH2-WzmfysiLsmvmtGsd1zt25APKiHxJN20N9sDGoHYrBSUEgA@mail.gmail.com >
<CANP8+jJYeYKjoH7TYXRvDBcG3jRWJz99hw3ubVKMUXrVko9BYQ@mail.gmail.com >
<CAH2-WzmMpW97m_uAiVfTF1swA06KREbEkKftX6WBcYoAVi867g@mail.gmail.com >
<CAH2-Wz=xVcWiErLo9t7og8FFL2-kKYRHY7sOxD2_bmDAaQVffQ@mail.gmail.com >
<CANP8+jKz71SvyH0-kUvh4ZEamZ+qV0wDoRrY-4Zjpw9NVxXJyw@mail.gmail.com >
<CAH2-Wzn_YAWLJqyByVfrHSskQP029AyZQ_fGNbV16wTC4z6f_g@mail.gmail.com >
<CANP8+jLDsGOAx2bWL-coFZCYTXWO9NYYb5QbS-d43K4n5-AhFw@mail.gmail.com >
<CA+TgmoZRUE5nk_Er4MpLEYAzcrRZ-BTTymg4_ayY3AUjx9U3OQ@mail.gmail.com >
<CAH2-WznrH8d_9LwjfO1YEn-WbYJhadXS3XmG-G5BLYe=c3yqdA@mail.gmail.com >
<50394f44-af78-b40f-313a-5b0f8a0450e4@2ndquadrant.com >
<CABOikdPjjG+JcdNeegrL7=BtPdJ6yEv--V4hU8KzJTTwX1SNmw@mail.gmail.com >
Hi,
On 02/07/2018 10:24 AM, Pavan Deolasee wrote:
>
> ...
>
> Here is v15 of the patch.
>
I've been looking at this version of the patch, mostly to educate myself
before attempting to write the "status summary".
One bit that I don't quite understand is GetXactWALBytes(). It pretty
much just returns XactLastRecEnd and is used in ExecMerge like this:
int64 startWAL = GetXactWALBytes();
bool qual = ExecQual(action->whenqual, econtext);
/*
* SQL Standard says that WHEN AND conditions must not
* write to the database, so check we haven't written
* any WAL during the test. Very sensible that is, since
* we can end up evaluating some tests multiple times if
* we have concurrent activity and complex WHEN clauses.
*
* XXX If we had some clear form of functional labelling
* we could use that, if we trusted it.
*/
if (startWAL < GetXactWALBytes())
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("cannot write to database ...")));
I think this actually fails to enforce the rule, because some writes may
not produce WAL (think of unlogged tables). I also suspect it may be
incorrect "in the opposite direction" because a query may not do any
changes and yet it may produce WAL (e.g. due to wal_hint_bits=true).
So we may need to think of a different way to enforce this ...
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
view thread (265+ messages) latest in thread
Message-ID: <0bd07f01-8c0e-1205-df90-a9ae77dafa5b@2ndquadrant.com>
Permalink: ../0bd07f01-8c0e-1205-df90-a9ae77dafa5b@2ndquadrant.com/
Also on: postgresql.org/message-id/0bd07f01-8c0e-1205-df90-a9ae77dafa5b@2ndquadrant.com
copy link · copy postgr.es
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: pgsql-hackers@postgresql.org
Cc: tomas.vondra@2ndquadrant.com, pavan.deolasee@gmail.com, pg@bowt.ie, robertmhaas@gmail.com, simon@2ndquadrant.com, alvherre@alvh.no-ip.org, andrew.dunstan@2ndquadrant.com, pavan.deolasee@2ndquadrant.com, sfrost@snowman.net
Subject: Re: [HACKERS] MERGE SQL Statement for PG11
In-Reply-To: <0bd07f01-8c0e-1205-df90-a9ae77dafa5b@2ndquadrant.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