pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Craig Ringer <craig@2ndquadrant.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: hstore dump/restore bug in 9.3
Date: Sun, 11 May 2014 23:48:53 -0400
Message-ID: <26582.1399866533@sss.pgh.pa.us> (raw)
In-Reply-To: <53703B71.2080807@2ndquadrant.com>
References: <53702D20.4070505@2ndquadrant.com>
	<53702F92.50404@2ndquadrant.com>
	<53703B71.2080807@2ndquadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Craig Ringer <craig@2ndquadrant.com> writes:
> On 05/12/2014 10:18 AM, Craig Ringer wrote:
>> Do we need a way to schema-qualify the operator used in NULLIF, or to
>> provide an operator alias that it gets dumped as?

> This looks like a bug that'll want backpatching and it's not a data loss
> risk, so I don't think it's urgent to shove this in before 9.4 closes.

FWIW, I don't think this is something we ought to back-patch.  NULLIF
is effectively defined in terms of "a = b", where the = operator is
whatever would be found by operator lookup.  It's probably better to
look for a default btree opclass, but that's a different behavior;
and one that will have its own failure modes, particularly if a and b
aren't of the same type.

It is worth noting that the SQL standard says in so many words:

	NULLIF (V1, V2) is equivalent to the following <case specification>:
	CASE WHEN V1=V2 THEN NULL ELSE V1 END

Now, you can argue about how literally they mean that; for one thing
I doubt they want you to evaluate V1 twice.  But nonetheless the
construct is defined in terms of an operator named "=".

Also, I think we still have some other dependencies on assumed
operator names in eg. CASE.  Cleaning up only NULLIF may not be a
full solution.

There have been past discussions of whether we ought to follow the
letter or the spirit of the standard's references to "=" and other
operators.  Don't recall if we came to any definitive conclusions,
but right now we're clearly not totally consistent on this point.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (6+ messages)  latest in thread

Message-ID: <26582.1399866533@sss.pgh.pa.us>
Permalink:  ../26582.1399866533@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26582.1399866533@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, craig@2ndquadrant.com
  Subject: Re: hstore dump/restore bug in 9.3
  In-Reply-To: <26582.1399866533@sss.pgh.pa.us>
  References: <53702D20.4070505@2ndquadrant.com> <53702F92.50404@2ndquadrant.com> <53703B71.2080807@2ndquadrant.com> <26582.1399866533@sss.pgh.pa.us>

* 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