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

"CREATE TABLE IF NOT EXISTS" results in a false-positive error if table already exists

Open
#52 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
postgresql, typescript
Domain
database, devops

Research direction

The report names no source file or test entry point. Reproduce the Entity Framework migration script with an existing __EFMigrationsHistory table, then trace how the PostgreSQL action handles the NOTICE and verify that this expected notice no longer causes the build to fail.

Written by the indexing model from the issue text.

Description

need-to-triage

Take a script like the auto-generated migration history table creation by Entity Framework:

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

This results in a false error if the table actually already exists:

psql:/home/runner/work/somethingsomething.sql:5: NOTICE:  relation "__EFMigrationsHistory" already exists, skipping
[...]
Error: Error occurred while running action:
Error: error in file: /home/runner/work/somethingsomething.sql
psql:/home/runner/work/somethingsomething.sql:5: NOTICE:  relation "__EFMigrationsHistory" already exists, skipping

Which subsequently and wrongly fails the build.

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.