-
Notifications
You must be signed in to change notification settings - Fork 32
Closed
Description
Original query (with fingerprint 91291afafdacd92a):
CREATE TABLE "Album"
(
"AlbumId" INT NOT NULL,
"Title" VARCHAR(160) NOT NULL,
"ArtistId" INT NOT NULL,
CONSTRAINT "PK_Album" PRIMARY KEY ("AlbumId")
)
Deparsed query (with fingerprint d37da9dd17c1175d):
CREATE TABLE "Album" (
"AlbumId" int NOT NULL,
"Title" varchar(160) NOT NULL,
"ArtistId" int NOT NULL,
CONSTRAINT PK_Album PRIMARY KEY ( "AlbumId" )
);
In the deparsed query, double quotes around PK_Album are removed. I am not sure if this makes the queries different but since the fingerprint changed, I raised this issue.
This is also true for "ALTER TABLE". Please let me know if I should open a separate issue for that.
To reproduce:
const fs = require('fs')
const { parse, deparse } = require('pgsql-parser');
async function main() {
const stmts = parse(`
CREATE TABLE "Album"
(
"AlbumId" INT NOT NULL,
"Title" VARCHAR(160) NOT NULL,
"ArtistId" INT NOT NULL,
CONSTRAINT "PK_Album" PRIMARY KEY ("AlbumId")
)
`)
const stmts2 = deparse(stmts[0])
console.log(stmts2)
}
main()
Schema at https://github.com/prisma/database-schema-examples/tree/main/postgres/chinook
Metadata
Metadata
Assignees
Labels
No labels