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

No support for function overloading #3660

Open
prog8 opened this issue Oct 18, 2024 · 1 comment · May be fixed by #3661
Open

No support for function overloading #3660

prog8 opened this issue Oct 18, 2024 · 1 comment · May be fixed by #3661
Labels
📚 postgresql bug Something isn't working

Comments

@prog8
Copy link

prog8 commented Oct 18, 2024

Version

1.27.0

What happened?

I have Postgresql schema where I define overloaded function to handle many column types.

CREATE FUNCTION foo(text)
CREATE FUNCTION foo(text[])

Unfortunately during schema parsing sqlc returns an errors saying that function foo already exists which is not true. The function is in fact defined by full signature, not just the name.

Relevant log output

relation "foo" already exists

Database schema

CREATE FUNCTION foo(text)
CREATE FUNCTION foo(text[])


### SQL queries

_No response_

### Configuration

_No response_

### Playground URL

_No response_

### What operating system are you using?

_No response_

### What database engines are you using?

_No response_

### What type of code are you generating?

_No response_
@prog8 prog8 added the bug Something isn't working label Oct 18, 2024
@prog8
Copy link
Author

prog8 commented Oct 18, 2024

I looked at details and it seems the problem is just text vs text[]. If I try with completely different type like text vs number the problem disappears. This makes me think that that in fact there is signature check but for some reason text is confused with text[] like they are the same type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 postgresql bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
@prog8 and others