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

Cannot SELECT when a column includes schema name #396

Open
davidfiala opened this issue Mar 31, 2024 · 0 comments
Open

Cannot SELECT when a column includes schema name #396

davidfiala opened this issue Mar 31, 2024 · 0 comments

Comments

@davidfiala
Copy link

Describe the bug

When selecting on columns and you happen to specify the schema name as part of the column, an error is reported.

Same applies to:

  • SELECT columns
  • WHERE clause
  • JOIN clause
🔨 Not supported 🔨 : The query you ran generated an AST which parts have not been read by the query planner. This means that those parts could be ignored:
    ⇨ .columns[0].expr.table.name ("foo")
👉 pg-mem is work-in-progress, and it would seem that you've hit one of its limits.
*️⃣ Reconsituted failed SQL statement: SELECT myschema.foo .apple  FROM myschema.foo
👉 You can file an issue at https://github.com/oguimbal/pg-mem along with a way to reproduce this error (if you can), and  the stacktrace:

To Reproduce

CREATE SCHEMA myschema;
CREATE TABLE "myschema"."foo" (apple integer);
INSERT INTO "myschema"."foo" (apple) values (10);
SELECT * FROM "myschema"."foo"; -- success
SELECT "foo"."apple" FROM "myschema"."foo"; -- success
SELECT "myschema"."foo"."apple" FROM "myschema"."foo"; -- fails

ditto if you use the default public schema:

CREATE TABLE "foo" (apple integer);
INSERT INTO "foo" (apple) values (10);
SELECT * FROM "foo"; -- success
SELECT "foo"."apple" FROM "public"."foo"; -- success
SELECT "public"."foo"."apple" FROM "public"."foo"; -- fails

-- ditto for WHERE "public"."foo"."apple" =
-- or INNER JOIN .... ON "public"."foo"."apple" = ....

pg-mem version

2.8.1

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

1 participant