microsoft/azuredatastudio-postgresql

Unhandled exception while executing query: 'list' object has no attribute 'encode'

nasc17 opened this issue · 1 comments

nasc17 commented

Run:
select * from pg_catalog.pg_proc
or
select proacl from pg_catalog.pg_proc

image

Possible workaround:
Discussed in #449
"The problem is ADS knows knows how to process basic encodings like integer (number,int,bigint,etc.) or string (varchar,etc.), there maybe more but I don't know what they are (maybe date and time?).

Encodings like CIDR causes problems. I can only assume your ip_address is an encoding that is not a varcahr. I am guessing there wasn't any logic put in place for ADS to process Postgres CIDR encodings.

You can add ::TEXT at the end of each attribute you are querying with an encoding type that ADS does not recognize (i.e. CIDR). Doing this will force ADS to convert the encoding to a string before presenting. From your example I would do the following.

select asset_id
,mac_address
,ip_address::TEXT
from public.dim_asset
Can you confirm if this helped? I bet you could do the same for other encoding types that ADS does not understand.

I would recommend ADS put this in their documentation because it is not obvious.
More so, I'd like to recommend ADS do this conversion for us so we don't have to. This application presents data, so obviously we want any weird encodings to be converted to strings for presentation."

Gonna piggyback here real quick to mention this issue that could be related, only difference is that the query is
select * from pg_database;,
will your PR fix this as well @DaeunYim ?
If not, I'm happy to raise a separate issue.