Describe the bug
Faced an error Unhandled exception while executing query: 'list' object has no attribute 'encode' when querying columns of type aclitem (catalog representation of access privileges).
To Reproduce
SELECT-statements to system tables which query column of type aclitem (limit for short output):
-- column relacl
SELECT relname, relacl
FROM pg_class
WHERE relacl IS NOT NULL LIMIT 2;
-- column attacl
SELECT attrelid::regclass, attname, attoptions, attacl
FROM pg_attribute
WHERE attacl IS NOT NULL LIMIT 2;
2. Error (same for both queries, result is exactly two rows)
SELECT 2
Unhandled exception while executing query: 'list' object has no attribute 'encode'
**Expected behavior**
psql (13.6) produces correct results (your output can be different based on privileges and roles in your system):
``` sql
SELECT relname, relacl
FROM pg_class
WHERE relacl IS NOT NULL LIMIT 2;
SELECT attrelid::regclass, attname, attoptions, attacl
FROM pg_attribute
WHERE attacl IS NOT NULL LIMIT 2;
attrelid
attname
attoptions
attacl
pg_subscription
subdbid
{=r/postgres}
pg_subscription
subname
{=r/postgres}
Desktop (please complete the following information):
OS: Windows Server 2019 x64 and Windows 10 x64
ADS:
ADS Version 1.47.1 (system setup)
ADS PostgresSQL extension version 0.6.0
PostgreSQL version 13.8, compiled by Visual C++ build 1914, 64-bit
Additional context
As a temporary solution I use function pg_catalog.array_to_string(array, delimiter) to convert each array element of aclitem type to its text representation:
SELECT relname, pg_catalog.array_to_string(relacl, ', ') as relacl
FROM pg_class
WHERE relacl IS NOT NULL LIMIT 2;
-- or just cast to text
SELECT relname, relacl::text as relacl
FROM pg_class
WHERE relacl IS NOT NULL LIMIT 2;
Describe the bug Faced an error
Unhandled exception while executing query: 'list' object has no attribute 'encode'
when querying columns of type aclitem (catalog representation of access privileges).To Reproduce
-- column attacl SELECT attrelid::regclass, attname, attoptions, attacl FROM pg_attribute WHERE attacl IS NOT NULL LIMIT 2;
SELECT 2 Unhandled exception while executing query: 'list' object has no attribute 'encode'
Desktop (please complete the following information):
ADS:
Additional context As a temporary solution I use function pg_catalog.array_to_string(array, delimiter) to convert each array element of aclitem type to its text representation: