pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Anders Steinlein <anders@e5r.no>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Different results from identical matviews
Date: Thu, 02 Jul 2020 17:44:53 -0400
Message-ID: <889660.1593726293@sss.pgh.pa.us> (raw)
In-Reply-To: <CAC35HN=Nj0fpZ-i=LEb8JxN6RtD5rZoE+zjLGb+JdcajRNby=g@mail.gmail.com>
References: <CAC35HNnNGavaZ=P=rUcwTwYEhfoyXDg32REXCRDgxBmC3No3nA@mail.gmail.com>
	<815598.1593648137@sss.pgh.pa.us>
	<CAC35HN=QPcSAw+Y47tOCZ51PysSgYzoO5bT7AK3q8VPvB8ZCcQ@mail.gmail.com>
	<849797.1593697489@sss.pgh.pa.us>
	<CAC35HNmfNmJNC34tKhWsLMx5D6wTJiQiKTuXQYDEBA2ADhRMUg@mail.gmail.com>
	<854382.1593704633@sss.pgh.pa.us>
	<CAC35HN=Nj0fpZ-i=LEb8JxN6RtD5rZoE+zjLGb+JdcajRNby=g@mail.gmail.com>

Anders Steinlein <anders@e5r.no> writes:
> On Thu, Jul 2, 2020 at 5:43 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Unfortunately,
>> since the reverse-listing of this join is just going to say "USING
>> (email)", there's no way to detect from human-readable output that the
>> interpretation of the USING clauses is different.  (We've contemplated
>> introducing not-SQL-standard syntax to allow flagging such cases, but
>> haven't pulled the trigger on that.)

> If I'm reading this correctly, would this be a "reason" to be more explicit
> when doing joins involving non-standard data types? I.e. would it be
> "safer" to do ON x1.email::citext == x2.email::citext instead of USING (if
> there is any difference at all...)?

Yes, it would be.  Of course then you don't get the "merging" of the two
join output columns into one, so you might have to qualify references a
bit more.

You might find this thread interesting:

https://www.postgresql.org/message-id/flat/ffefc172-a487-aa87-a0e7-472bf29735c8%40gmail.com

			regards, tom lane





view thread (21+ messages)  latest in thread

Message-ID: <889660.1593726293@sss.pgh.pa.us>
Permalink:  ../889660.1593726293@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/889660.1593726293@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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, anders@e5r.no
  Subject: Re: Different results from identical matviews
  In-Reply-To: <889660.1593726293@sss.pgh.pa.us>
  References: <CAC35HNnNGavaZ=P=rUcwTwYEhfoyXDg32REXCRDgxBmC3No3nA@mail.gmail.com> <815598.1593648137@sss.pgh.pa.us> <CAC35HN=QPcSAw+Y47tOCZ51PysSgYzoO5bT7AK3q8VPvB8ZCcQ@mail.gmail.com> <849797.1593697489@sss.pgh.pa.us> <CAC35HNmfNmJNC34tKhWsLMx5D6wTJiQiKTuXQYDEBA2ADhRMUg@mail.gmail.com> <854382.1593704633@sss.pgh.pa.us> <CAC35HN=Nj0fpZ-i=LEb8JxN6RtD5rZoE+zjLGb+JdcajRNby=g@mail.gmail.com> <889660.1593726293@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