neondatabase / neon

Neon: Serverless Postgres. We separated storage and compute to offer autoscaling, code-like database branching, and scale to zero.
https://neon.tech
Apache License 2.0
15.31k stars 446 forks source link

Epic: Support Postgres event triggers #7570

Open danieltprice opened 7 months ago

danieltprice commented 7 months ago

Add support for event triggers to capture DDL events: https://www.postgresql.org/docs/current/event-triggers.html

We currently do not support event triggers due to the superuser requirement.

Related slack thread: https://neondb.slack.com/archives/C03QLRH7PPD/p1710592909306899

User requests: https://discord.com/channels/1176467419317940276/1216517379366846474/1216517382898454639 https://community.neon.tech/t/permission-denied-to-create-event-trigger/443

clarkbw commented 5 months ago

Supported by RDS https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Concepts.General.FeatureSupport.html#PostgreSQL.Concepts.General.FeatureSupport.EventTriggers

clarkbw commented 4 months ago

Integration partners need to capture DDL events and use EVENT TRIGGERS to listen for them. Is it possible that, instead of trying to allow for event triggers completely, we offer a specific function to register for DDL events of a table. Partners need the DDL events, not necessarily the event triggers.

ololobus commented 4 months ago

Use-case from Readyset https://github.com/readysettech/readyset/blob/7bf77a8558908dab347ffa09130494a9c984c5d5/replicators/src/postgres_connector/ddl_replication.sql#L24-L50

ololobus commented 4 months ago

Probably https://github.com/xataio/pgroll needs event triggers as well Discussion https://neondb.slack.com/archives/C026T7K2YP9/p1717520052520779

rishi-raj-jain commented 3 months ago

Probably https://github.com/xataio/pgroll needs event triggers as well Discussion https://neondb.slack.com/archives/C026T7K2YP9/p1717520052520779

just fyi, issues tab on pgroll to me suggests that it's not advisable as a go-to

erikmunson commented 1 week ago

what's the expected timeline/priority of implementing this? i see #8808 was opened in august but it looks like there has been no movement since then.

aboodman commented 1 week ago

This will be needed for Neon to be a fully supported target for https://zerosync.dev too. Without ability to receive correct DDL events transactionally, Neon can only ever be used with Zero (and other local first systems) for small deployments.

Happy to work with anyone on your team to define the minimal interface needed if full event triggers are too difficult.