Skip to content

All Sequence/Index Relations Display "relation does <relation> does not exist" on Trunk #1639

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

Closed
ryan-berger opened this issue May 24, 2022 · 2 comments · Fixed by #1640
Closed
Labels
bug Something isn't working triage New issues that hasn't been reviewed

Comments

@ryan-berger
Copy link
Contributor

ryan-berger commented May 24, 2022

Version

1.13.0

What happened?

As I was trying to debug another sqlc issue to implement a fix, I built a development version with make sqlc-dev, and got:

relation "xxx_idx" does not exist

Which does not happen on 1.13. I don't have time to investigate this thoroughly tonight, but it looks like it comes from this commit: dfe438

It also seems that the metadata is always pointing that the compilation error is coming from 1:1 no matter where the error is coming from. (EDIT: this happens no matter the version, so ignore this)

cc @jakoguta

Relevant log output

# package test
query.sql:1:1: relation "temp_idx" does not exist
query.sql:1:1: relation "temp_seq" does not exist

Database schema

CREATE TABLE temp(a TEXT);

CREATE INDEX temp_idx ON temp(a);
ALTER INDEX temp_idx ATTACH PARTITION temp_partition_idx;


CREATE SEQUENCE temp_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER TABLE temp_seq OWNER TO a;

SQL queries

N/A

Configuration

No response

Playground URL

No response

What operating system are you using?

Linux

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@ryan-berger ryan-berger added bug Something isn't working triage New issues that hasn't been reviewed labels May 24, 2022
@jakoguta
Copy link
Contributor

Let me investigate this issue and report back.

@jakoguta
Copy link
Contributor

@ryan-berger you were right the commit: dfe438 introduced a bug. I have made a PR #1640 to fix the bug. I have also used your example in the endtoend test to ensure this fix is solid. Thank you for catching and investigating the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues that hasn't been reviewed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants