Skip to content

Commit f9cd746

Browse files
committed
copy
1 parent 0946936 commit f9cd746

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

packages/deparser/src/deparser.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5461,7 +5461,20 @@ export class Deparser implements DeparserVisitor {
54615461
: argValue;
54625462
return `${node.defname} = ${quotedValue}`;
54635463
}
5464-
5464+
5465+
// Handle CopyStmt WITH clause options - uppercase format without quotes
5466+
if (context.parentNodeTypes.includes('CopyStmt')) {
5467+
if (node.defname === 'format' && node.arg && this.getNodeType(node.arg) === 'String') {
5468+
const stringData = this.getNodeData(node.arg);
5469+
return `FORMAT ${stringData.sval.toUpperCase()}`;
5470+
}
5471+
// Handle other COPY options with uppercase defname
5472+
if (node.arg) {
5473+
return `${node.defname.toUpperCase()} ${argValue}`;
5474+
}
5475+
return node.defname.toUpperCase();
5476+
}
5477+
54655478
// Handle CREATE OPERATOR and CREATE TYPE context
54665479
if (context.parentNodeTypes.includes('DefineStmt')) {
54675480
const preservedName = this.preserveOperatorDefElemCase(node.defname);

0 commit comments

Comments
 (0)