Skip to content

fix(drizzle-kit): silence raw NOTICE objects from postgres-js driver#5648

Closed
SAY-5 wants to merge 1 commit intodrizzle-team:mainfrom
SAY-5:fix/drizzle-kit-postgres-notice-spam
Closed

fix(drizzle-kit): silence raw NOTICE objects from postgres-js driver#5648
SAY-5 wants to merge 1 commit intodrizzle-team:mainfrom
SAY-5:fix/drizzle-kit-postgres-notice-spam

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented Apr 15, 2026

When the postgres-js driver path runs internal idempotent statements like CREATE SCHEMA IF NOT EXISTS drizzle and CREATE TABLE IF NOT EXISTS drizzle.__drizzle_migrations, PostgreSQL emits NOTICE messages on subsequent runs. postgres.js's default onnotice handler prints the raw NOTICE objects to stdout, which dumps unstructured payloads on top of drizzle-kit's own output during drizzle-kit migrate.

Pass an empty onnotice to suppress this. Errors are still surfaced through the normal query rejection path, so this is purely cosmetic output cleanup.

Before:

{
  severity_local: 'NOTICE',
  severity: 'NOTICE',
  code: '42P06',
  message: 'schema "drizzle" already exists, skipping',
  file: 'schemacmds.c',
  line: '132',
  routine: 'CreateSchemaCommand'
}
{
  severity_local: 'NOTICE',
  severity: 'NOTICE',
  code: '42P07',
  message: 'relation "__drizzle_migrations" already exists, skipping',
  ...
}

After: clean drizzle-kit output, no raw NOTICE dump.

Closes #5643

When the postgres-js driver path runs internal idempotent statements
like `CREATE SCHEMA IF NOT EXISTS drizzle` and `CREATE TABLE IF NOT
EXISTS drizzle.__drizzle_migrations`, PostgreSQL emits NOTICE
messages on subsequent runs. postgres.js's default `onnotice` handler
prints the raw NOTICE objects to stdout, which dumps unstructured
payloads on top of drizzle-kit's own output during `drizzle-kit
migrate`.

Pass an empty `onnotice` to suppress this. Errors are still surfaced
through the normal query rejection path, so this is purely cosmetic
output cleanup.

Closes #5643
@SAY-5 SAY-5 closed this by deleting the head repository Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: drizzle-kit migrate prints raw postgres NOTICE objects for successful IF NOT EXISTS migrations

1 participant