Skip to content

Instantly share code, notes, and snippets.

@wchargin
Created January 8, 2022 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wchargin/6fd1ded5c683bc2420eb59ad53aeb5b7 to your computer and use it in GitHub Desktop.
Save wchargin/6fd1ded5c683bc2420eb59ad53aeb5b7 to your computer and use it in GitHub Desktop.
$ createdb test_input
$ psql test_input -c "CREATE TABLE strs(s text); INSERT INTO strs(s) VALUES('-- hi');"
INSERT 0 1
$ createdb test_output
$ pg_dump test_input | sed -e '/^--/d' | psql test_output
SET
SET
SET
SET
SET
set_config
------------
(1 row)
SET
SET
SET
SET
SET
SET
CREATE TABLE
ALTER TABLE
COPY 0
$ psql test_input -c "TABLE strs"
s
-------
-- hi
(1 row)
$ psql test_output -c "TABLE strs"
s
---
(0 rows)
$ psql --version
psql (PostgreSQL) 12.8 (Ubuntu 12.8-1.pgdg20.04+1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment