Re: [PATCH] Rename "getdatabaseencoding()" to "pg_database_encoding()", and document

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Rename "getdatabaseencoding()" to "pg_database_encoding()", and document
Date: 2026-07-17 07:24:24
Message-ID: 540A1172-161A-48CC-8827-BF89AFA156AC@yesql.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 17 Jul 2026, at 08:44, Ian Lawrence Barwick <barwick(at)gmail(dot)com> wrote:

> It was noted here [1] that we have the undocumented SQL function
> "getdatabaseencoding()", used mainly in regression tests and a couple
> of psql queries. While considering a documentation patch, it occurred
> to me that it's a horrible function name which doesn't look like other
> public functions, and we already have "pg_client_encoding()", so why not
> rename it to match that while we're at it?

This function seems to be referred to in extensions, how about adding keeping
the existin name and adding the new name as an alias? It would keep existing
code from breaking and cause less churn in the code.

--
Daniel Gustafsson

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2026-07-17 07:57:31 Re: Follow-up fixes for online wal_level change
Previous Message Jelte Fennema-Nio 2026-07-17 07:14:55 Re: Tags in the commitfest app: How to use them and what tags to add?