Skip to content

Instantly share code, notes, and snippets.

@kelvintaywl
Created December 22, 2016 08:45
Show Gist options
  • Save kelvintaywl/cdcd92d003fb479187d8373d11f54225 to your computer and use it in GitHub Desktop.
Save kelvintaywl/cdcd92d003fb479187d8373d11f54225 to your computer and use it in GitHub Desktop.

See current version

SELECT version();

Check if DB recovery is paused

SELECT pg_is_xlog_replay_paused();

Check delay of DB recovery since last (possibly slow) transaction

SELECT NOW() - pg_last_xact_replay_timestamp();

Copy CSV contents to table (assuming CSV rows are w/o header and follows table columns serially)

COPY [table_name] FROM '[file_path]' DELIMITER ',' CSV;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment