Skip to content

How do I implement LISTEN/NOTIFY using a native database/sql connection? #1301

Answered by jackc
abhijit-hota asked this question in Q&A
Discussion options

You must be logged in to vote

Use conn.Raw() to get a *pgx.Conn from a *sql.Conn. See https://pkg.go.dev/github.com/jackc/pgx/[email protected]/stdlib for example.

Then use the *pgx.Conn as you would outside of database/sql.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@abhijit-hota
Comment options

Answer selected by abhijit-hota
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants