W
W
Win32Sector2017-04-26 19:18:49
PostgreSQL
Win32Sector, 2017-04-26 19:18:49

How to execute queries against postgresql database in script?

Comrades, tell me, please, how can I write in the script to delete the database, create the database and then cut the rights to a couple of users?
The idea is this: a dump of the N base from another server is uploaded to the server, then you need to drop the N base on the current server, create it, upload the dump there and cut the rights.
That is,
drop database N;
create database N;
Grant all privileges on database N to superpuperadmin;
How to stuff all this into a bash script?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2017-04-26
@Win32Sector

https://www.postgresql.org/docs/current/static/app...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question