Skip to content

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

Description

@FranckPachot

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions