Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excluding "CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog" in pg_dump

Tags:

postgresql

Is there a way to have the "CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog" directive excluded in the result of a pg_dump?

pg_dump -Fp -O 1.2.0 > /directory/1.2.0.sql

like image 404
Lee Avatar asked Mar 11 '17 18:03

Lee


1 Answers

Yes, you can use sed to comment that specific line out:

pg_dump -Fp -O 1.2.0 | \
sed -e 's/CREATE EXTENSION IF NOT EXISTS plpgsql/-- CREATE EXTENSION IF NOT EXISTS plpgsql/g' \
 > /directory/1.2.0.sql
like image 165
Gab Avatar answered Oct 14 '22 21:10

Gab