You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL dumps can have multi-line queries, for instance:
CREATETABLEusers (
id SERIALPRIMARY KEY,
name VARCHAR(50) NOT NULL,
email VARCHAR(50) NOT NULL UNIQUE
);
In such a case using postgres -E as here will error out because the command expects single line statements.
The solution to which can be postgres -j -E, but I think it is ideal to load the dumps with psql command instead -- as suggested in the postgres official doc.
Proposed solution
Context: The reason for using postgres is that we won't have the postgres server running while the init script is running.
We can run initialScript.before using postgres (as init script, before starting the server) and have initialScript.after run with psql as a process dependent on the postgres server.
Ideally, to keep things uniform, I would prefer running all init SQL commands via psql.
The text was updated successfully, but these errors were encountered:
SQL dumps can have multi-line queries, for instance:
In such a case using
postgres -E
as here will error out because the command expects single line statements.The solution to which can be
postgres -j -E
, but I think it is ideal to load the dumps withpsql
command instead -- as suggested in the postgres official doc.Proposed solution
Context: The reason for using
postgres
is that we won't have the postgres server running while the init script is running.We can run
initialScript.before
usingpostgres
(as init script, before starting the server) and haveinitialScript.after
run withpsql
as a process dependent on the postgres server.Ideally, to keep things uniform, I would prefer running all init SQL commands via psql.
The text was updated successfully, but these errors were encountered: