Skip to content

Postgres: NOTICE messages from upstream are never relayed to the client #1698

Open

Description

@sandaru1

Summary

A Postgres server can send a NoticeResponse wire message alongside a query's real result -- for diagnostic/informational messages that aren't errors (DROP TABLE IF EXISTS on a nonexistent table, CREATE TABLE IF NOT EXISTS on an existing one, RAISE NOTICE in PL/pgSQL, etc.). PHP's pgsql extension exposes the last one received via pg_last_notice().

Through Readyset, pg_last_notice() is always empty, for every kind of notice tested -- confirmed via source that this isn't a partial or conditional gap: neither psql-srv nor readyset-psql has any reference to NoticeResponse anywhere. There's no code path that could relay this message type to a downstream client, regardless of what upstream sends.

Steps to reproduce

Requires PHP with the pgsql extension.

readyset --database-type postgresql \
  --upstream-db-url postgresql://<user>:<pw>@127.0.0.1:5432/<db> \
  --allow-unauthenticated-connections --auto-cache \
  --address 127.0.0.1:5497 --deployment repro --disable-telemetry
<?php
$conn = pg_connect('host=127.0.0.1 port=5497 dbname=<db> user=<user> password=<pw>');
pg_query($conn, "DROP TABLE IF EXISTS definitely_does_not_exist_xyz");
echo pg_last_notice($conn) . "\n";
direct Postgres: NOTICE:  table "definitely_does_not_exist_xyz" does not exist, skipping
readyset:        (empty string)

Confirmed with two independent notice sources -- a genuine DDL-generated notice (DROP TABLE IF EXISTS/CREATE TABLE IF NOT EXISTS against a nonexistent/existing relation) and a PL/pgSQL RAISE NOTICE inside a DO $$ ... $$ block (which requires actual server-side execution, ruling out any "Readyset can't run this at all" explanation -- the query itself succeeds, only the notice is lost):

direct:   RAISE NOTICE 'hello from notice'  -> pg_last_notice() = 'NOTICE:  hello from notice'
readyset: RAISE NOTICE 'hello from notice'  -> pg_last_notice() = ''

Expected behavior

pg_last_notice() should reflect the real notice message Postgres produced for the query, matching direct Postgres, regardless of the notice's source (DDL, PL/pgSQL RAISE, etc.).

Actual behavior

Notices are always silently lost. Confirmed via source that NoticeResponse (the Postgres wire message this data travels in) has zero references anywhere in psql-srv or readyset-psql -- there's no relay path to drop, one was simply never built.

ReadySet version

main @ 5b5b2fb832095c90340be2db8009fc2d63af11c8 (2026-08-12/15 build), PostgreSQL 17.10 upstream.

Activity

  1. added
    bug
    on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions