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

Bug: ALTER TABLE SET SCHEMA #1409

Merged
merged 2 commits into from
Feb 2, 2022
Merged

Conversation

timwmillard
Copy link
Contributor

@timwmillard timwmillard commented Feb 2, 2022

Once a table schema has been changes via ALTER TABLE <name> SET SCHEMA <new_schema>, any UPDATE queries do not recognise the new table name.

Example:
schema.sql

CREATE SCHEMA foo;
CREATE TABLE bar (name text);
ALTER TABLE bar SET SCHEMA foo;

queries.sql

-- name: UpdateFooBar :exec
UPDATE foo.bar SET name = $1;

The compiler does not recognise the foo.bar table and throws an error.

- `UPDATE` queries do not reconises the new schema.
@kyleconroy kyleconroy merged commit 41b2386 into sqlc-dev:main Feb 2, 2022
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

Successfully merging this pull request may close these issues.

2 participants