Re: BUG #14834: quote_literal and composite types, different behaviour between sql and plpgsql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dvd(at)gnx(dot)it
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14834: quote_literal and composite types, different behaviour between sql and plpgsql
Date: 2017-09-28 17:37:45
Message-ID: 1328.1506620265@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

dvd(at)gnx(dot)it writes:
> I found that `quote_literal` behaviour is wrong when used in a plpgsql
> function over a null composite type, let me show:

No, there's nothing wrong with quote_literal. Your example is showing
that plpgsql converts a "null" composite value into a row-of-nulls,
when dealing with a variable of a named composite type (in this case,
the variable is the parameter "val"). This is arguably wrong, but plpgsql
has been doing that for a mighty long time so people are hesitant to
change it.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message aistrong.hs 2017-09-29 09:28:41 BUG #14836: Is there an option to change and run isolation level only for a single statement as in DB2
Previous Message Tomas Vondra 2017-09-28 17:14:05 Re: BUG #14835: Postgres crashed