Skip to content

The payload data should not be passed via pg_notify, but instead accessed from the DB by the listener #9

@spwoodcock

Description

@spwoodcock

Is your feature request related to a problem? Please describe.

Follow on from #8

  • There is a 8000 byte limit for pg_notify data, which isn't much.
  • This obviously doesn't work for sending large submission XML data.

Describe the solution you'd like

  • Instead of aggregating all data for the payload in the trigger, perhaps we actually need to pass a lightweight object through pg_notify, then have the listener gather all the data required from the DB before posting:
PERFORM pg_notify('odk-events', jsonb_build_object(
  'action', TG_OP,
  'type', action_type,
  'id', NEW.id
)::text);
  • We pass the entity or submission def ID, then get the data from the listener code.

The downside here (and reason for not doing this originally), is the need for two db transactions, not just one.

Describe alternatives you've considered

  • Handling submission related events separately, as this is probably only where we will have issues (entity / review events will generally have smaller payloads).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions