GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Bug: SQL Syntax Error "IF NOT EXISTS" on PostgreSQL 16+ Migrations · Issue #837 · NdoleStudio/httpsms

Bug: SQL Syntax Error "IF NOT EXISTS" on PostgreSQL 16+ Migrations #837

New issue
Copy link
New issue
Copy link
Closed
Closed
Bug: SQL Syntax Error "IF NOT EXISTS" on PostgreSQL 16+ Migrations#837
Copy link

Description

@Ankitd013
Ankitd013
opened on Mar 20, 2026
Issue body actions

While attempting to run httpsms with a PostgreSQL 18.3 (Alpine) backend, the auto-migration fails during the schema initialization/update phase. The application attempts to use IF NOT EXISTS syntax for ALTER TABLE ... ADD CONSTRAINT, which is not supported in standard PostgreSQL.

Error Logs:
ERROR: syntax error at or near "EXISTS" at character 42
STATEMENT:
ALTER TABLE users ADD CONSTRAINT IF NOT EXISTS uni_users_api_key CHECK (api_key IS NOT NULL);
ALTER TABLE phone_api_keys ADD CONSTRAINT IF NOT EXISTS uni_phone_api_keys_api_key CHECK (api_key IS NOT NULL);
ALTER TABLE discords ADD CONSTRAINT IF NOT EXISTS uni_discords_server_id CHECK (server_id IS NOT NULL);

Environment:
PostgreSQL Version: 18.3 (compiled by gcc Alpine 15.2.0)
Deployment: Docker Compose
Image: postgres:alpine

Steps to Reproduce:
Use a standard postgres:alpine image in a docker-compose setup.
Point the httpsms API service to this database.
Observe the logs during the initial container startup/migration phase.

Activity

  1. AchoArnold commented on Mar 22, 2026

    @AchoArnold
    AchoArnold
    on Mar 22, 2026
    Member
    More actions

    Thanks For the bug report @Ankitd013 The issue has been fixed in my latest commit.

  2. AchoArnold
    closed this as completedin f4a634don Mar 22, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.