I have created an index.sql
file which contains index creating script for 95 table
for example
DROP INDEX IF EXISTS gtab03_vrctrlid_idx cascade; CREATE UNIQUE INDEX gtab03_vrctrlid_idx ON gtab03 USING btree (vrctrlid);
I have consolidated all table's index creating script
to a file called index.sql
I need to run the entire script at a time, is it possible to execute the index.sql
file using psql
To run DDL in the form of an SQL script, you should use psql , the same command you use to connect to the server interactively. I recommend using ON_ERROR_STOP=1 and -1 , so it runs the DDL in a single transaction and aborts on any error.
Is this what you mean?
\i e:/myFolder/index.sql;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With