You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’d like the “Import/Export Data” tool in pgAdmin 4 (v9.1) to include a “Force Quote All Columns” checkbox in the Options tab. This would add the FORCE_QUOTE option to the underlying COPY command, ensuring all CSV values—header and data—are quoted with the specified quote character (e.g., ").
For example, with my table "simple" (columns a, b, c as VARCHAR), I export using Delimiter ; and Quote ", excluding column c. I currently get:
a;b
1;4
2;5
3;6
one;two
But I'd like to get:
"a";"b"
"1";"4"
"2";"5"
"3";"6"
"one";"two"
This would make exports consistent and easier to use in tools expecting fully quoted CSVs, without needing to switch to psql.
I’ve tried a few workarounds:
Using psql with \copy: This works perfectly with a command like:
sql
\copy (SELECT 'a' AS "a", 'b' AS "b" UNION ALL SELECT a, b FROM simple) TO 'C:\path\to\file.csv' WITH (FORMAT CSV, DELIMITER ';', QUOTE '"', FORCE_QUOTE ("a", "b"))
It gives me the quoted output I want, but it’s a hassle to leave pgAdmin, open psql, and write a custom query—especially for quick exports.
Thanks a lot!
The text was updated successfully, but these errors were encountered:
I’d like the “Import/Export Data” tool in pgAdmin 4 (v9.1) to include a “Force Quote All Columns” checkbox in the Options tab. This would add the FORCE_QUOTE option to the underlying COPY command, ensuring all CSV values—header and data—are quoted with the specified quote character (e.g., ").
For example, with my table "simple" (columns a, b, c as VARCHAR), I export using Delimiter ; and Quote ", excluding column c. I currently get:
a;b
1;4
2;5
3;6
one;two
But I'd like to get:
"a";"b"
"1";"4"
"2";"5"
"3";"6"
"one";"two"
This would make exports consistent and easier to use in tools expecting fully quoted CSVs, without needing to switch to psql.
I’ve tried a few workarounds:
Using psql with \copy: This works perfectly with a command like:
sql
\copy (SELECT 'a' AS "a", 'b' AS "b" UNION ALL SELECT a, b FROM simple) TO 'C:\path\to\file.csv' WITH (FORMAT CSV, DELIMITER ';', QUOTE '"', FORCE_QUOTE ("a", "b"))
It gives me the quoted output I want, but it’s a hassle to leave pgAdmin, open psql, and write a custom query—especially for quick exports.
Thanks a lot!
The text was updated successfully, but these errors were encountered: