Skip to content

Instantly share code, notes, and snippets.


ks-t0/insert.sql Secret

Last active December 23, 2021 02:48
What would you like to do?
\set file_path '/home/user/sql/'
\set sq '\''
\set file :sq:file_path:file_name:sq
\set command '\\copy tmp from ' :file ' delimiter ':sq',':sq ' csv header;'
create temp table tmp (
aaa integer
, bbb varchar
, ccc varchar
INSERT INTO test_table (
, bbb
, ccc
, create_datetime
, update_datetime
, tmp.bbb
, tmp.ccc
, current_timestamp
, current_timestamp
FROM tmp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment