You can either CREATE DATABASE somedb WITH OWNER myappuser - or preferably, create the database owned by a different user to your webapp user and then expicitly GRANT the webapp user the minimum required permissions. Create a new PostgreSQL user without superuser, createdb or createuser rights and use that for your application. You should not be using it for your application it's like running your server as root, ie a really bad idea. They're well written and will teach you a lot about SQL in general as well as Pg in particular.īTW, the postgres user is a superuser. The PostgreSQL documentation and tutorial are highly recommended, too. If in doubt, connect to Pg with psql and run \l to list databases, or connect via PgAdmin-III. ![]() ![]() Unlke SQLite's default behaviour, Pg doesn't create databases when you try to connect to a database that doesn't exist yet.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |