-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: support NOTIFY, LISTEN, and UNLISTEN commands of postgresql #41522
Comments
The https://github.com/lib/pq test suite tests this as well |
I think that this would be pretty easy to implement with changefeeds. Here's a mini proposal:
When a user runs
The goroutine filters the changefeed for rows with When a user runs
When a user runs
When a user runs Once changefeeds can be filtered in SQL, we can accordingly update the implementation to be more efficient. |
Might be a decent Friday project! |
Our S3 lambda notifications are published into cockroach db. Monitoring lambda events with
Are there any options or workaround? |
Closes cockroachdb#41522. This commit enables LISTEN/NOTIFY. Rangefeeds must be enabled. One problem is that the 32 bit session ID is back to bite us from cockroachdb#34520. We don't have a 32 bit identifier that's unique across all sessions of the cluster. Currently, we report the NodeID for the PID of the notifying process instead. Release note (sql change): implement the LISTEN/NOTIFY Postgres protocol; LISTEN, NOTIFY, UNLISTEN, and pg_notify.
did this feature make it into a release ? |
This is also useful for popular Rails ActiveJob adapters such as Good Job and Que, since they rely on NOTIFY/LISTEN. |
A Serverless user inquired about this feature. Curious about @amruss or @shermanCRL thoughts on Jordan's suggestion to user changefeeds. @rafiss seems like the issue was on a closed project so moving to SQL Experience temporarily |
Hey CockroachLabs, I appreciate this is a big undertaking but also an important one. Could you please advise where it's on the priority list? Cheers |
AFAIK this feature hasn't been prioritized yet, so it won't be available at least until 24.1 (and perhaps even later), cc @dikshant |
Understood. I believe that having that functionality would unlock a broader adoption for CockroachDB. For example we have two packages in our current codebase that rely on NOTIFY/LISTEN and I believe it's the case with many other products out there. |
We don't have plans to invest in this area right now. Could you tell us more about your use case? Some or most of this functionality can be achieved in CockroachDB today using Changefeeds: Changefeed: Enterprise Changefeed: |
I think the use case was listed in the comment above. You have a codebase and cockroachdb is sold as a dropin replacement. The use case is taking an existing codebase with Notify/Listen and try it with cockroachdb. |
@dikshant if that's an official CockroachDB position, it's quite hard to comprehend. CDC is a completely separate feature that doesn't enable using CockroachDB with libraries relying on NOTIFY/LISTEN. Is there anyone else who can provide more details as to why this functionality is not a part of the foreseeable future? |
From my POV, I use PG as a queue in some instances with https://github.com/graphile/worker and I'd rather have NOTIFY/LISTEN than polling. It is pretty much the only thing stopping me from moving over at the moment. |
Our use-case is that we'd rather stay with our current work queue infrastructure running on Postgres, than switch to a database where we cannot use the current work queue system (https://github.com/bensheldon/good_job). |
Hello :) An other use case (that should be a showcase) is Odoo, a big ERP using Postgresql. They use |
I'm here for the exact same reason For reference: odoo/odoo#83730 |
I have the same issue with the Hangfire library, i'm implementing cockroach and think CHANGEFEED can do the trick just fine |
I honestly don't know how CocktoachDB is planning to compete with modern databases like SurrealDB that offer a complete change stream out of the box when they don't even support established features of such relic databases like PostgreSQL. /Yevhenii On 2 Feb 2024, at 01:14, XavXander ***@***.***> wrote:
Our use-case is that we'd rather stay with our current work queue infrastructure running on Postgres, than switch to a database where we cannot use the current work queue system (https://github.com/bensheldon/good_job).
I have the same issue with the Hangfire library, will try to implement a custom infrastructure so it can notify with DB or some external provider
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Part of: cockroachdb#41522 Release note: None
Part of: cockroachdb#41522 Release note: None
Built on top of#127818, which adds parsing support, this patch adds the capability to send asynchronous notifications to clients over the pgwire protocol. Part of: cockroachdb#41522 Release note: None
Add a new system table, system.notifications, to back the LISTEN/NOTIFY mechanism. Part of: cockroachdb#41522 Release note: None
PostgreSQL has support for NOTIFY, LISTEN, and UNLISTEN commands which generate and listen for a notification, respectively. This is not a part of SQL standard; however, some ORMs (like go-pg) seems to be using it.
Jira issue: CRDB-5438
The text was updated successfully, but these errors were encountered: