Skip to content

DDL drop type: Server should reognize that composite types dropped with parameters are incorrect #369

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

Open
2 tasks done
Donnerstagnacht opened this issue Apr 22, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Donnerstagnacht
Copy link

Donnerstagnacht commented Apr 22, 2025

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Dropping a composite type with referencing the property types and names is classified correctly as error while referencing the property types only (as with functions) is not detected.

CREATE TYPE if EXISTS group_composite AS (id int, name text);

DROP TYPE if EXISTS group_composite; -- no error => correct
DROP TYPE if EXISTS group_composite (int, text); -- no error => incorrect, should be error: Error: ERROR: 42601: type modifier is not allowed for type "group_composite"

DROP TYPE if EXISTS group_composite (id int, name text); -- error => correct
Image

To Reproduce

  1. Create a type and drop it referencing the parameters (as with functions).

Expected behavior

The server should detect that a type can not be dropped with referenced parameters

As specified in: https://www.postgresql.org/docs/current/sql-droptype.html

System information

  • OS: windows 11
  • editor: vs-code
  • pls: 0.5.0
@Donnerstagnacht Donnerstagnacht added the bug Something isn't working label Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant