pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: Staroverov Ilja <i.staroverov@ftdata.ru>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: jj-zhang25@mails.tsinghua.edu.cn <jj-zhang25@mails.tsinghua.edu.cn>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #19644: byteaout, float8out and float4out are marked IMMUTABLE but depend on GUCs
Date: Tue, 20 Oct 2026 12:18:05 -0400
Message-ID: <871538.1792513085@sss.pgh.pa.us> (raw)
In-Reply-To: <CAHGQGwG8DDiQhZus8rW0D4McvkOYGeGxmr70bn0S15jVqHGHJQ@mail.gmail.com>
References: <19644-d6db3fb5e5ad92f4@postgresql.org>
	<CAHGQGwFPDZ8bMW6adGtAiEmMWQ8hTPCV_1APtoTQ38+2bXXgWA@mail.gmail.com>
	<1306744.1788318959@sss.pgh.pa.us>
	<CAHGQGwFSh8ZJxVWYMQ5S6pagN_eGuF7eA6GBZ9xY-futHL1hpQ@mail.gmail.com>
	<1577102.1788542839@sss.pgh.pa.us>
	<CAHGQGwEtYBEaDsJyHs-rw4AZZRjsPAtMpxPxKU7PsQyY=ZFOZw@mail.gmail.com>
	<61ca987c-8bd1-4380-b81a-72c94c36b41c@eisentraut.org>
	<CAHGQGwHU_0Dfdzo9eUPzD0e7+4pvYKyU1YsVP57EsxyAEFWDiQ@mail.gmail.com>
	<C79ADC9A-5DFE-4B5C-8C78-012802D31531@localhost.localdomain>
	<CAHGQGwG8DDiQhZus8rW0D4McvkOYGeGxmr70bn0S15jVqHGHJQ@mail.gmail.com>

Fujii Masao <masao.fujii@gmail.com> writes:
> Codex reported two other cases:

> - Both xpath() overloads are marked IMMUTABLE, but use float8out() for
>    numeric results, so their output depends on extra_float_digits.
> - quote_ident(text) is marked IMMUTABLE, but calls quote_identifier(),
>    whose output depends on quote_all_identifiers.

> Should these functions also be marked STABLE? Thoughts?

I don't mind marking xpath() as STABLE, but I wonder if doing so for
quote_ident() would cause performance issues.  But a quick look
through our frontend programs didn't turn up any usages that look
like they'd be candidates for constant-folding, so maybe it's fine.

I agree we can't just leave it as-is, so the alternative would be
to force the SQL function to use one behavior or the other.  That
might make people unhappy in a different way.

			regards, tom lane






view thread (15+ messages)  latest in thread

Message-ID: <871538.1792513085@sss.pgh.pa.us>
Permalink:  ../871538.1792513085@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/871538.1792513085@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, masao.fujii@gmail.com, i.staroverov@ftdata.ru, peter@eisentraut.org, jj-zhang25@mails.tsinghua.edu.cn
  Subject: Re: BUG #19644: byteaout, float8out and float4out are marked IMMUTABLE but depend on GUCs
  In-Reply-To: <871538.1792513085@sss.pgh.pa.us>
  References: <19644-d6db3fb5e5ad92f4@postgresql.org> <CAHGQGwFPDZ8bMW6adGtAiEmMWQ8hTPCV_1APtoTQ38+2bXXgWA@mail.gmail.com> <1306744.1788318959@sss.pgh.pa.us> <CAHGQGwFSh8ZJxVWYMQ5S6pagN_eGuF7eA6GBZ9xY-futHL1hpQ@mail.gmail.com> <1577102.1788542839@sss.pgh.pa.us> <CAHGQGwEtYBEaDsJyHs-rw4AZZRjsPAtMpxPxKU7PsQyY=ZFOZw@mail.gmail.com> <61ca987c-8bd1-4380-b81a-72c94c36b41c@eisentraut.org> <CAHGQGwHU_0Dfdzo9eUPzD0e7+4pvYKyU1YsVP57EsxyAEFWDiQ@mail.gmail.com> <C79ADC9A-5DFE-4B5C-8C78-012802D31531@localhost.localdomain> <CAHGQGwG8DDiQhZus8rW0D4McvkOYGeGxmr70bn0S15jVqHGHJQ@mail.gmail.com> <871538.1792513085@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