By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,542 Members | 1,434 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,542 IT Pros & Developers. It's quick & easy.

created databases as other users...

P: n/a
Is it possible to create a database to be owned by a user that only
exists to postgresql or do they have to be shell accounts as well.

$ createdb --owner=testcon testdb

but the owner ends up being postgres

I'm planning to create a different database for each different project I
have. I want these users to be only used to connect to the db, not have
a shell account. So far, my only experience has been on a closed
network where all users already have shell access.


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jonathan Villa <jv****@innovativesource.net> writes:
$ createdb --owner=testcon testdb
but the owner ends up being postgres


I don't think so.

$ createuser testcon
Shall the new user be allowed to create databases? (y/n) n
Shall the new user be allowed to create more new users? (y/n) n
CREATE USER
$ createdb --owner=testcon testdb
CREATE DATABASE
$ psql -l
List of databases
Name | Owner | Encoding
------------+---------+-----------
pltest | tgl | SQL_ASCII
regression | tgl | SQL_ASCII
template0 | tgl | SQL_ASCII
template1 | tgl | SQL_ASCII
testdb | testcon | SQL_ASCII
(5 rows)

$

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #2

P: n/a
For some reason, I never tried

$psql --username=testcon testdb

I'm trying to use phpPGAdmin at the same time...I guess I was having a
tough time using both...

thanks Tom for the reply.
On Mon, 2004-10-11 at 16:01, Tom Lane wrote:
Jonathan Villa <jv****@innovativesource.net> writes:
$ createdb --owner=testcon testdb
but the owner ends up being postgres


I don't think so.

$ createuser testcon
Shall the new user be allowed to create databases? (y/n) n
Shall the new user be allowed to create more new users? (y/n) n
CREATE USER
$ createdb --owner=testcon testdb
CREATE DATABASE
$ psql -l
List of databases
Name | Owner | Encoding
------------+---------+-----------
pltest | tgl | SQL_ASCII
regression | tgl | SQL_ASCII
template0 | tgl | SQL_ASCII
template1 | tgl | SQL_ASCII
testdb | testcon | SQL_ASCII
(5 rows)

$

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.