Original query (with fingerprint 7bbdf5f425075dd4):
COMMENT ON COLUMN public.posts.reply_to_post_number IS 'If this post is a reply to another, this column is the post_number of the post it''s replying to. [FKEY posts.topic_id, posts.post_number]'
Deparsed query (with fingerprint 0):
COMMENT ON COLUMN public.posts.reply_to_post_number IS E'If this post is a reply to another, this column is the post_number of the post it's replying to. [FKEY posts.topic_id, posts.post_number]';
- The deparsed query also fails parsing with
Error: syntax error at or near "s" 🤔
To reproduce:
const fs = require('fs')
const { parse, deparse } = require('pgsql-parser');
async function main() {
const stmts = parse(`
COMMENT ON COLUMN public.posts.reply_to_post_number IS 'If this post is a reply to another, this column is the post_number of the post it''s replying to. [FKEY posts.topic_id, posts.post_number]'
`)
const stmts2 = deparse(stmts[0])
console.log(stmts2)
}
main()
Schema at https://github.com/prisma/database-schema-examples/tree/main/postgres/discourse