microsoft / microsoft/vscode-pgsql
Unhandled exception while executing query: 'list' object has no attribute 'encode'
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 395
- Forks
- 33
- Avg merge
- 1h 46m
- Merged PRs (30d)
- 3
Description
Describe the bug
When querying pgrowlocks() provided by the pgrowlocks extension, we get this error.
Example, in one session:
create table demo as select 1;
begin;
delete from demo;
Then in vscode:
create extension pgrowlocks;
select * from pgrowlocks('demo');
11:16:02 AM
Started executing query at Line 55
Unhandled exception while executing query: 'list' object has no attribute 'encode'
Total execution time: 00:00:00.108
When casting "xids" to text it works:
select locked_row, locker, multi, xids::text[], modes, pids from pgrowlocks('demo');
To Reproduce
No need to install the extension to test it:
drop function if exists myfunction();
create or replace function myfunction()
returns table (
xids xid[]
)
language sql
as $$
select
array['123'::xid]
$$;
select xids from myfunction();
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the SQL reproduction in the issue, including the pgrowlocks query and the myfunction() query returning xid[]. Trace how the extension handles the returned array value and add or update a regression test for this case; done means selecting the xid[] result no longer raises the encode exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100