1

Postgres permits distribution and management with CREATE EXTENSION. Is it more proper to write internal EXTENSIONS to manage third-party provided data, or to use scripts that DROP and CREATE SCHEMA? What are the pro's and con's to both?

Right now I tend to write,

./mySchema.psql
./mySchema/01_schema.sql
./mySchema/02_datatypes.sql
./mySchema/10_tables.sql

Etc.

And, I install all of that into SCHEMA mySchema. I'm wondering if I should change my flow and upgrade to use CREATE EXTENSION.

asked Nov 10, 2016 at 21:05

1 Answer 1

0

It may make sense to distribute to third party PG users as EXTENSIONS, but it doesn't make sense to bundle their data as EXTENSIONS.

  • it's more work,
  • it won't be backed up by pg_dump

Because it won't be backed up by pg_dump, you'll have to add to your development repository their data rather than just the initial load scripts. For the added complexity of backing things up, it doesn't seem advisable to do this.

answered Nov 10, 2016 at 21:23

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.