create schema accept_schema_copy;
set current_schema to 'accept_schema_copy';
set behavior_compat_options to 'accept_empty_str';
create table t ("t_varchar" varchar, "t_text" text, "t_char" char(10), "t_bytea" bytea);
insert into t values('abc', 'abc', 'abc', 'abc'), (' ', ' ', ' ', ' '), ('', '', '', '');
create table t_stdin ("t_varchar" varchar, "t_text" text, "t_char" char(10), "t_bytea" bytea);
create table t_csv ("t_varchar" varchar, "t_text" text, "t_char" char(10), "t_bytea" bytea);
create table t_text_tab ("t_varchar" varchar, "t_text" text, "t_char" char(10), "t_bytea" bytea);
create table t_binary ("t_varchar" varchar, "t_text" text, "t_char" char(10), "t_bytea" bytea);
COPY t TO '@abs_srcdir@/data/datanode1/accept_t_csv.data' WITH(FORMAT 'csv');
COPY t TO '@abs_srcdir@/data/datanode1/accept_t_text.data' WITH(FORMAT 'text');
COPY t TO '@abs_srcdir@/data/datanode1/accept_t_binary.data' WITH(FORMAT 'binary');
COPY t_csv FROM '@abs_srcdir@/data/datanode1/accept_t_csv.data' WITH(FORMAT 'csv');
COPY t_text_tab FROM '@abs_srcdir@/data/datanode1/accept_t_text.data' WITH(FORMAT 'text');
COPY t_binary FROM '@abs_srcdir@/data/datanode1/accept_t_binary.data' WITH(FORMAT 'binary');
SELECT * FROM t;
t_varchar | t_text | t_char | t_bytea
-----------+--------+------------+----------
abc | abc | abc | \x616263
| | | \x202020
| | | \x
(3 rows)
SELECT * FROM t_csv;
t_varchar | t_text | t_char | t_bytea
-----------+--------+------------+----------
abc | abc | abc | \x616263
| | | \x202020
| | | \x
(3 rows)
SELECT * FROM t_text_tab;
t_varchar | t_text | t_char | t_bytea
-----------+--------+------------+----------
abc | abc | abc | \x616263
| | | \x202020
| | | \x
(3 rows)
SELECT * FROM t_binary;
t_varchar | t_text | t_char | t_bytea
-----------+--------+------------+----------
abc | abc | abc | \x616263
| | | \x202020
| | | \x
(3 rows)
SELECT "t_varchar" is null as "varchar is null", "t_text" is null as "text is null", "t_char" is null as "char is null", "t_bytea" is null as "bytea is null" FROM t;
varchar is null | text is null | char is null | bytea is null
-----------------+--------------+--------------+---------------
f | f | f | f
f | f | f | f
f | f | f | f
(3 rows)
SELECT "t_varchar" is null as "varchar is null", "t_text" is null as "text is null", "t_char" is null as "char is null", "t_bytea" is null as "bytea is null" FROM t_csv;
varchar is null | text is null | char is null | bytea is null
-----------------+--------------+--------------+---------------
f | f | f | f
f | f | f | f
f | f | f | f
(3 rows)
SELECT "t_varchar" is null as "varchar is null", "t_text" is null as "text is null", "t_char" is null as "char is null", "t_bytea" is null as "bytea is null" FROM t_text_tab;
varchar is null | text is null | char is null | bytea is null
-----------------+--------------+--------------+---------------
f | f | f | f
f | f | f | f
f | f | f | f
(3 rows)
SELECT "t_varchar" is null as "varchar is null", "t_text" is null as "text is null", "t_char" is null as "char is null", "t_bytea" is null as "bytea is null" FROM t_binary;
varchar is null | text is null | char is null | bytea is null
-----------------+--------------+--------------+---------------
f | f | f | f
f | f | f | f
f | f | f | f
(3 rows)
\d t;
Table "accept_schema_copy.t"
Column | Type | Modifiers
-----------+-------------------+-----------
t_varchar | character varying |
t_text | text |
t_char | character(10) |
t_bytea | bytea |
\d t_csv;
Table "accept_schema_copy.t_csv"
Column | Type | Modifiers
-----------+-------------------+-----------
t_varchar | character varying |
t_text | text |
t_char | character(10) |
t_bytea | bytea |
\d t_text;
\d t_binary;
Table "accept_schema_copy.t_binary"
Column | Type | Modifiers
-----------+-------------------+-----------
t_varchar | character varying |
t_text | text |
t_char | character(10) |
t_bytea | bytea |