S
S
samizdam2015-02-24 00:25:22
PHP
samizdam, 2015-02-24 00:25:22

What is the best way to make a correct and portable postgres schema dump for the lib installer?

There is a small library / framework that requires a sql database to work. I plan to support the main engines.
In the case of MySQL, you can use the usual + prefix for tables. This approach allows you to use the lib on almost any server - it runs as sql on behalf of an existing user in the context of an existing database and everything is ok. Postgres has a lot of nuances that I'm not familiar with. What is the best way to dump with schema and reference data for ease of installation, maximum portability, and minimal server provisioning requirements? So far I have stopped at but it does not seem to be designed to be executed as sql, and pulls out a specific schema (public), which also confuses me.
drop table if exist / create table
pg_dump -x -O --inserts -c
PS: Of course, I looked towards solutions for migrations, but I didn’t find anything cross-platform enough from the ready-made ones. And expanding the existing ones (the same ZF2 / Db / Sql / Ddl) to the required degree is too expensive, it's easier to do with a dump for each of the platforms.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question