Skip to content

Commit 742a318

Browse files
fix: don't quote type names - they are not identifiers
Type names like 'int' and 'timestamp' should not be quoted even though they are TYPE_FUNC_NAME_KEYWORDS. The quoteIdentifier function is meant for SQL identifiers (table names, column names, etc.), not for type names which have their own grammar rules in PostgreSQL. Co-Authored-By: Dan Lynch <[email protected]>
1 parent fb278ad commit 742a318

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/deparser/src/deparser.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,8 +1883,7 @@ export class Deparser implements DeparserVisitor {
18831883
return output.join(' ');
18841884
}
18851885

1886-
const quotedTypeName = QuoteUtils.quoteIdentifier(typeName);
1887-
let result = mods(quotedTypeName, args);
1886+
let result = mods(typeName, args);
18881887

18891888
if (node.arrayBounds && node.arrayBounds.length > 0) {
18901889
result += formatArrayBounds(node.arrayBounds);

0 commit comments

Comments
 (0)