Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid input syntax for type oid: "{oid}" when running \d on an index #1462

Closed
3 tasks done
muusik opened this issue May 9, 2024 · 4 comments
Closed
3 tasks done

Comments

@muusik
Copy link

muusik commented May 9, 2024

Description

When I run \d on an index, or a schema that contains an index, I get this error:

LINE 12: ...s FROM pg_catalog.pg_index i WHERE i.indexrelid = '{oid}') T...

I can recreate that in a freshly created postgres db:

~> createdb test
~> pgcli test
Server: PostgreSQL 16.2 (Debian 16.2-2+b1)
Version: 4.0.1
Home: http://pgcli.com
test> create table public.test(id int primary key)
CREATE TABLE
Time: 0.013s
test> \d public.
invalid input syntax for type oid: "{oid}"
LINE 12: ...s FROM pg_catalog.pg_index i WHERE i.indexrelid = '{oid}') T...
                                                              ^
Time: 0.006s

Your environment

  • Please provide your OS and version information.
    Debian Testing
  • Please provide your CLI version.
    4.0.1
  • What is the output of pip freeze command.
    cli_helpers==2.3.1
    click==8.1.7
    configobj==5.0.8
    pendulum==3.0.0
    pgcli==4.0.1
    pgspecial==2.1.1
    prompt-toolkit==3.0.43
    psycopg==3.1.18
    Pygments==2.18.0
    python-dateutil==2.9.0.post0
    setproctitle==1.3.3
    six==1.16.0
    sqlparse==0.4.4
    tabulate==0.9.0
    typing_extensions==4.11.0
    tzdata==2024.1
    wcwidth==0.2.13
@dbaty
Copy link
Member

dbaty commented May 10, 2024

I can only reproduce the error when \d is given a "pattern", such as \d public. (note the trailing dot). If given a full name table/index/... name, the command works as expected.

This is a bug in pgspecial, a dependency of pgcli. It's been fixed 2 weeks ago (see dbcli/pgspecial@25a8e15), but there has not been any release of pgspecial yet.

@j-bennet: considering that pgspecial does not see much commits, we're likely to wait for a while becore seeing any major bug fixes there. Perhaps we should release a new version of pgspecial now?

@muusik
Copy link
Author

muusik commented May 11, 2024

Thanks! Using a git checkout of pgspecial solves the issue for me.

@j-bennet
Copy link
Contributor

@dbaty @muusik I can release pgspecial, no problem.

@j-bennet
Copy link
Contributor

2.1.2 is released: https://pypi.org/project/pgspecial/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants