microsoft / azuredatastudio-postgresql

azuredatastudio-postgresql is an extension for Azure Data Studio that enables you to work with PostgreSQL databases
Other
193 stars 36 forks source link

Error when executing table resulting function, having arrays: 'tuple' object has no attribute 'encode' #483

Closed n8allan closed 9 months ago

n8allan commented 9 months ago

The full output:

Started executing query at Line 3
Commands completed successfully
Unhandled exception while executing query: 'tuple' object has no attribute 'encode'
Total execution time: 00:00:00.180

Here is a simple reproduction:

create or replace function test_func()
returns table (attr text[], arr int[]) language plpgsql as $$
begin
    return query select '{Test}'::text[], '{1}'::int[];
end;
$$;

select test_func();

Azure Data Studio info: Version: 1.45.1 (user setup) Commit: 88c21b1725a3e79440027bdb7b5a55fb036be0e2 Date: 2023-08-03T00:42:37.945Z VS Code: 1.79.2 Electron: 22.3.14 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19045

Also reproduced on v1.46.1

nasc17 commented 9 months ago

Duplicate of #449

Bug has been addressed in our unstable release of PostgreSQL extension v0.5.1-insiders. We would appreciate your verification that it has been handled appropriately.

n8allan commented 9 months ago

Okay, thanks. How does one switch to that insiders build? Do you have to switch to the insiders version of Azure Data Studio?

nasc17 commented 9 months ago

@n8allan You can continue to use the stable Azure Data Studio

  1. Install the pre-release version the PostgreSQL extension here: https://github.com/microsoft/azuredatastudio-postgresql/releases/tag/v0.5.1-insiders

  2. From the "File" menu in Azure Data Studio select "Install Extension from VSIX Package"

  3. Select the "azuredatastudio-postgresql-*.vsix" file downloaded from prior step.

n8allan commented 9 months ago

Okay, thank for all the help! I can confirm that my use case is fixed in the v0.5.1 extension.

LSIND commented 8 months ago

Hello! I also faced that problem and can confirm that in v0.5.1 ext it was fixed. Thanks!