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

DROP FUNCTION regression #535

Closed
maxhawkins opened this issue Jun 5, 2020 · 3 comments
Closed

DROP FUNCTION regression #535

maxhawkins opened this issue Jun 5, 2020 · 3 comments

Comments

@maxhawkins
Copy link
Contributor

maxhawkins commented Jun 5, 2020

After enabling the experimental parser, this query compiles but it shouldn't:

CREATE FUNCTION f(x INT) RETURNS INT AS 'SELECT x' LANGUAGE sql;

DROP FUNCTION f;

-- name: F :one
SELECT f(1);

Tracking on issue #537

@maxhawkins
Copy link
Contributor Author

maxhawkins commented Jun 5, 2020

Here's another one. This query compiles on older versions of sqlc but doesn't compile on HEAD:

CREATE FUNCTION f(x TIMESTAMPTZ) RETURNS void AS '' LANGUAGE sql;

DROP FUNCTION f(timestamp with time zone);

It doesn't recognize f(timestamp with time zone) is the same as f(timestamptz)

It seems the issue is one gets saved in the catalog as timestamptz and the other gets saved as pg_catalog.timestamptz.

Tracking on issue #538

@maxhawkins
Copy link
Contributor Author

maxhawkins commented Jun 5, 2020

One more. This query returns a TABLE. It throws the error query.sql:1:1: relation "f" does not exist

CREATE FUNCTION f(x TIMESTAMPTZ) RETURNS TABLE (y INT) AS 'SELECT 1' LANGUAGE sql;

DROP FUNCTION f(TIMESTAMPTZ);

Tracking on issue #539

@maxhawkins
Copy link
Contributor Author

I was able to track down each of these issues to different bugs, so I created separate issues and am closing this one.

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