指定生成文件格式

最近更新时间: 2025-02-18 16:02:00

  • 生成csv格式。
  • 复制
    复制成功
postgres=# copy public.t to '/data/pgxz/t.txt' with csv;
COPY 3
postgres=# \! cat /data/pgxz/t.txt
1,TDSQL PG,,7
2,pgxc,2017-10-28 18:24:05.643102,3
3,pgxz,2017-10-28 18:24:05.645691,
  • 生成二进制格式。
  • 复制
    复制成功
postgres=# copy public.t to '/data/pgxz/t.txt' with binary;
COPY 3
postgres=# \1
postgres=# \! cat /data/pgxz/t.txt
PGCOPY
TDSQL PG

默认为TEXT格式。