Cannot SELECT when a column includes schema name
davidfiala opened this issue Β· comments
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