Skip to content

PostgreSQL schema/table qualification does not escape embedded quotes #30213

Description

@JoeRoddy

Type: identifier lowering correctness. Target: prisma/orm PostgreSQL target.

No database is needed for the standalone constructor case:

const ns = new PostgresSchema({ id: "public", entries: { table: {} } });
ns.qualifyTable('quoted"post');

Actual output is "public"."quoted"post"; the valid quoted identifier form is "public"."quoted""post". qualifyTable directly interpolates schema and table names between double quotes. The schema ID needs the same escaping treatment.

Expected behavior: qualification should produce a valid PostgreSQL identifier for supported mapped schema and table names. Relevant regression inputs include quotes, Unicode, spaces, periods, and NUL.

The reproduction uses only a benign embedded quote and demonstrates malformed output.

Primary source: PostgresSchema.qualifyTable.

Environment

  • @prisma/orm-postgres: 8.0.0-rc.8 (the live latest tag when reverified September 6, 2026)
  • Prisma CLI: 8.0.0-rc.13
  • TypeScript: 5.9.3
  • Node: 26.5.0
  • npm: 11.17.0
  • OS: macOS 26.6.2 arm64
  • PostgreSQL: 14.23 for database-backed cases

Activity

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