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

NOTIFY channel length limit #13

Open
jedwards1211 opened this issue Dec 19, 2018 · 2 comments
Open

NOTIFY channel length limit #13

jedwards1211 opened this issue Dec 19, 2018 · 2 comments

Comments

@jedwards1211
Copy link

jedwards1211 commented Dec 19, 2018

It seems that Postgres (9.5 at least) limits the length of channels for NOTIFY and LISTEN:

# LISTEN "pg/tables/TagNotificationTriggers/tag/_org/1/JSON Test/battery/1/lifetimeWh";
NOTICE:  identifier "pg/tables/TagNotificationTriggers/tag/_org/1/JSON Test/battery/1/lifetimeWh"
  will be truncated to "pg/tables/TagNotificationTriggers/tag/_org/1/JSON Test/battery/"

Finding out about this was a bit of a rude awakening. I just complained on the Postgres mailing list that no channel length limit is mentioned in their documentation. I don't know if graphql-postgres-subscriptions has a way to catch the NOTICE from postgres, but at the very least it would probably be helpful for graphql-postgres-subscriptions print a warning to the console if a topic is longer than 63 characters.

@jedwards1211
Copy link
Author

I didn't realize, given that channel is an identifier, it's subject to the same restrictions as any identifier (63 characters)

@jedwards1211
Copy link
Author

I just discovered that notify/listen silently fails in pg-ipc if the channel is too long:

emilbayes/pg-ipc#2

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