Closed lessdantu closed 6 months ago
Execute this:
usql postgres://admin:@127.0.0.1/jquerydb?sslmode=disable <<EOF
drop table if exists public.tmp_schema; create table public.tmp_schema as select * from pg2sync.kaftabs_schema limit 2;
\echo "--> public.tmp_schema ..." \copy csv://. postgres://admin:@127.0.0.1/jquerydb?sslmode=disable 'select * from schema' 'public.tmp_schema'
\echo "--> tmp_schema ..." \copy csv://. postgres://admin:@127.0.0.1/jquerydb?sslmode=disable 'select * from schema' 'tmp_schema(insttype, dbname, schemaname, tabname, colno, colname, coltype, isprimary, cntkey)'
EOF
The result:
Connected with driver postgres (PostgreSQL 9.4.26) DROP TABLE CREATE TABLE
--> public.tmp_schema ... error: failed to prepare insert query: pq: relation "public.tmp_schema" does not exist
--> tmp_schema ... COPY 76
Execute this:
usql postgres://admin:@127.0.0.1/jquerydb?sslmode=disable <<EOF
drop table if exists public.tmp_schema; create table public.tmp_schema as select * from pg2sync.kaftabs_schema limit 2;
\echo "--> public.tmp_schema ..." \copy csv://. postgres://admin:@127.0.0.1/jquerydb?sslmode=disable 'select * from schema' 'public.tmp_schema'
\echo "--> tmp_schema ..." \copy csv://. postgres://admin:@127.0.0.1/jquerydb?sslmode=disable 'select * from schema' 'tmp_schema(insttype, dbname, schemaname, tabname, colno, colname, coltype, isprimary, cntkey)'
EOF
The result:
Connected with driver postgres (PostgreSQL 9.4.26) DROP TABLE CREATE TABLE
--> public.tmp_schema ... error: failed to prepare insert query: pq: relation "public.tmp_schema" does not exist
--> tmp_schema ... COPY 76