Last active
September 11, 2017 05:14
-
-
Save dirkjanfaber/f89f77f77c81a1db52af to your computer and use it in GitHub Desktop.
JSON notify message for PostgreSQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select pg_notify('json', row_to_json(x)::text) as notify | |
from (select 'hello world' as message, 42 as answer ) x; |
Thanks for your post.It is very use full for me.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I never send too large messages with the notifications. If a message would become too long, I'd probably add a link to the complete message in one of the json fields. Or an id + view on how to fetch the needed extra info.