Hi

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?

The only minor niggle I can see is that psql uses "getdatabaseencoding()"
for tab completion of collation names, and it looks like it would be
tricky/ugly to try and shoehorn in version-dependent queries for backwards
compatibility, but we can just substitute "current_setting('server_encoding')".

[1] 
https://www.postgresql.org/message-id/flat/allgZ34IHVFZo35b%40paquier.xyz#be92a887e2abe944926cdce750ae73e1

Regards

Ian Barwick

Attachment: v1-0001-Rename-getdatabaseencoding-to-pg_database_encodin.patch
Description: Binary data

Reply via email to