pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Daniele Varrazzo <daniele.varrazzo@gmail.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: Types pollution with unknown oids and server-side parameters binding
Date: Tue, 03 May 2022 19:17:38 -0400
Message-ID: <2241548.1651619858@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwYuaW2bc8JczGOgYgJHpsKNh6LNc0GGqLep+YgaD0jm_A@mail.gmail.com>
References: <CA+mi_8bQPwf8zwg7GeoqhvccNuze-hyDODACCL0Dj=x_kaE7Bw@mail.gmail.com>
	<2189979.1651607722@sss.pgh.pa.us>
	<CA+mi_8YXZcyMSuRdjmVQLsf7BB=_CJDigYk1Qu1WBuHFzY0G-Q@mail.gmail.com>
	<CAKFQuwYuaW2bc8JczGOgYgJHpsKNh6LNc0GGqLep+YgaD0jm_A@mail.gmail.com>

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tue, May 3, 2022 at 3:35 PM Daniele Varrazzo <daniele.varrazzo@gmail.com>
> wrote:
>> Looking at the above variation of the problem, maybe the right thing
>> to do would be to throw an error because the parameter can be
>> interpreted in different ways in different places? I seem to
>> understand, from David's example, that such an error is thrown, in
>> other contexts.

> That horse has already left the barn.

Well, perhaps not.  It's certainly not great that the behavior depends
on non-obvious implementation details.  I could imagine changing to
a rule that says "if an unknown-type parameter is referenced more than
once, we must infer the same type for it at each of those places",
rather than "first one in parsing order wins".

What's not very clear is whether such a change would make more people
happy than sad.  It'd almost inevitably break some queries that had
coincidentally gotten the behavior their authors wanted.  But the
key word there is "coincidentally", I suspect.

> I do
> think that trying to clarify "first" better, since it's not the
> in-your-face textual order that is being used.

I'm not thrilled with having to document the parsing order, especially
since it's arbitrary in some places (e.g., why RETURNING before the
UPDATE list --- that doesn't seem to make a lot of sense).

			regards, tom lane





view thread (8+ messages)  latest in thread

Message-ID: <2241548.1651619858@sss.pgh.pa.us>
Permalink:  ../2241548.1651619858@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2241548.1651619858@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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, daniele.varrazzo@gmail.com
  Subject: Re: Types pollution with unknown oids and server-side parameters binding
  In-Reply-To: <2241548.1651619858@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