Instead of creating a superuser you may simply grant the privilege on the database: CREATE ROLE alex LOGIN PASSWORD '...'; GRANT CREATE ON DATABASE icare TO alex; Bye Charles From: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Charles Clavadetscher Hello I never used pg_restore, but I assume that it works similarly to other PG tools, i.e. if you don’t specify a user to connect to the database it will take your unix user name. I assume that your step number 6 is the closing of the shell where you were as user postgres because after 5 you already are out of psql. So the questions is, if you have a DB user alex with the Create privilege on the database icare. If not you may try the following: - Open a psql terminal (steps 1-3) - CREATE ROLE alex LOGIN SUPERUSER PASSWORD '...'; And try the pg_restore again (steps 5-7). You may also try to omit step 6 but then all you DB objects will be owned by postgres. If this is what you need it is fine. Hope this helps. Bye Charles From: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Alex Luya Ubuntu 14.04 64bit + postgresql 9.4 are used here; What I have done are: 1,Sign In ubuntu by user alex 2,then:sudo -i -u postgres 3,then:psql jump into command client 4,then: create database icare; 5,then: \q jump out command client 6,then run: exit jump out psql 7,then pg_restore --clean --create --exit-on-error --dbname=icare icare-test.tar On Fri, Nov 13, 2015 at 10:52 PM, Giuseppe Sacco <giuseppe@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
|