Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`psql` outputs it's `NOTICE` messages to stderr causing the action to fail

Open
#33 9 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
postgresql, typescript
Domain
databases, devops

Research direction

Read src/PsqlFilesExecutor.ts at the linked lines to trace how psql stderr and its exit code are handled. Reproduce the migration scenario described in the issue, then verify that NOTICE output no longer fails the action while genuine psql failures still do.

Written by the indexing model from the issue text.

Description

need-to-triage

psql outputs it's NOTICE messages to stderr causing the whole action to fail even if the exit code is 0.
The offending lines of code:
https://github.com/Azure/postgresql/blob/f82d2b25075a9092d3ee987db9c77bcfc43fc6bc/src/PsqlFilesExecutor.ts#L27-L33
https://github.com/Azure/postgresql/blob/f82d2b25075a9092d3ee987db9c77bcfc43fc6bc/src/PsqlFilesExecutor.ts#L38-L40
NOTICE's should be treated as warnings not errors those would be EXCEPTION's.

Maybe there should be an option for choosing to ignore stderr and instead rely on the exit code of psql

It's trivial to get a NOTICE to fail the action.
Consider the following output generated by dotnet ef migrations script -s Proj.Bootstrap -p Proj.Data --idempotent -o migration.sql:

CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
    "MigrationId" character varying(150) NOT NULL,
    "ProductVersion" character varying(32) NOT NULL,
    CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
);

START TRANSACTION;
....
COMMIT;

If the __EFMigrationsHistory table already exists, the action fails, because psql:/migration.sql:5: NOTICE: relation "__EFMigrationsHistory" already exists, skipping gets written to stderr.

Dominant language
TypeScript
Stars
25
Forks
22
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/postgresql

All issues in Azure/postgresql

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.