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

pgmq_create doesn't validate queue names #33

Closed
v0idpwn opened this issue Aug 9, 2023 · 3 comments
Closed

pgmq_create doesn't validate queue names #33

v0idpwn opened this issue Aug 9, 2023 · 3 comments

Comments

@v0idpwn
Copy link
Collaborator

v0idpwn commented Aug 9, 2023

Extension version: 0.10
Postgres version: 15.3 (I'm running your docker image)

Current behaviour

Some characters that aren't allowed cause error 22000:

>select * from pgmq_create('hello-world');
SQL Error [22000]

Very long names get truncated and cause issues:

>select * from pgmq_create('veryloooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongstring'); 
SQL Error [42703]: column "deleted_at" does not exist

Expected behaviour

If the name is valid, queue is created normally. If it isn't, error early.

This should also probably be documented somewhere.

@ChuckHend
Copy link
Member

ChuckHend commented Aug 9, 2023

Nice find! Table name length limitation is 63 characters in postgres, so we probably just add that check in the below and handle the error reporting back to user

pub fn check_input(input: &str) -> Result<(), PgmqError> {

Thoughts?
 

@vrmiguel
Copy link
Member

I feel like we already handle pgmq_create('hello-world') but need some way of providing a better error message to the user

@ChuckHend
Copy link
Member

@vrmiguel - did #37 close this, or was there something we wanted to do before we marked this one done?

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

3 participants