Skip to content

postgresql cli - list databases errors because of missing pg_encoding_to_char udf #174

@ybrs

Description

@ybrs

Postgresql cli sends this query for \l (list databases)

query: "select d.datname as \"name\", pg_get_userbyid(d.datdba) as \"owner\", pg_encoding_to_char(d.encoding) as \"encoding\", case d.datlocprovider when 'c' then 'libc' when 'i' then 'icu' end as \"locale provider\", d.datcollate as \"collate\", d.datctype as \"ctype\", d.daticulocale as \"icu locale\", d.daticurules as \"icu rules\", array_to_string(d.datacl, e'\\n') as \"access privileges\" from pg_catalog.pg_database as d order by 1"

Which results in

[2025-09-20T21:14:05Z INFO  datafusion_postgres::handlers] Sending error: Error during planning: Invalid function 'pg_encoding_to_char'.
    Did you mean 'string_to_array'?

To reproduce

Testing with latest master with

cargo run -- --csv data:delhiclimate.csv

and connect with psql 16 client.

psql -h localhost  -U postgres
psql (16.10 (Ubuntu 16.10-0ubuntu0.24.04.1), server 16.6-pgwire-0.32.1)
Type "help" for help.

postgres=> \l
ERROR:  Error during planning: Invalid function 'pg_encoding_to_char'.
Did you mean 'pg_get_expr'?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions