Thread: "Database does not exist"... but it does exist
I'm running into a bizarre issue with "database XYZ does not exist." I've done a lot of searching, but can't find the cause. For the sake of reference, this is PG 8.4.6 running on RHEL 5.4. Here's what I've done so far with md5 authentication enabled: psql -U postgres -c "create user miket with password 'miket'" createdb testingdb -U postgres psql -U postgres -d testingdb -c "create schema testingdb authorization miket" psql -U postgres -d testingdb -c "grant all privileges on database testingdb to miket" The last statement returns the following: ERROR: database "testindb" does not exist When I run: psql -l -U postgres testindb most certainly does exist. Any help on resolving this would be greatly appreciated. Thanks, Mike
On Jan 21, 2011, at 10:31 PM, Mike Thomsen wrote: > > psql -l -U postgres Plz share the output of command Vibhor Kumar EnterpriseDB Corporation The Enterprise Postgres Company Cell: +91-932-568-2279 vibhor.kumar@enterprisedb.com Blog:http://vibhork.blogspot.com
On 21 January 2011 17:01, Mike Thomsen <mikerthomsen@gmail.com> wrote: > I'm running into a bizarre issue with "database XYZ does not exist." > I've done a lot of searching, but can't find the cause. For the sake > of reference, this is PG 8.4.6 running on RHEL 5.4. > > Here's what I've done so far with md5 authentication enabled: > > psql -U postgres -c "create user miket with password 'miket'" > createdb testingdb -U postgres > psql -U postgres -d testingdb -c "create schema testingdb authorization miket" > psql -U postgres -d testingdb -c "grant all privileges on database > testingdb to miket" > > The last statement returns the following: > > ERROR: database "testindb" does not exist > > When I run: > > psql -l -U postgres > > testindb most certainly does exist. > > Any help on resolving this would be greatly appreciated. > > Thanks, > > Mike Are you sure that's not a typo. Your statement says "testingdb" but the error says "testindb". -- Thom Brown Twitter: @darkixion IRC (freenode): dark_ixion Registered Linux user: #516935
On Fri, 21 Jan 2011 12:01:40 -0500, Mike Thomsen <mikerthomsen@gmail.com> wrote: ... > psql -U postgres -c "create user miket with password 'miket'" > createdb testingdb -U postgres > psql -U postgres -d testingdb -c "create schema testingdb authorization > miket" psql -U postgres -d testingdb -c "grant all privileges on database > testingdb to miket" I guess that if you used the 1st line you weren't 'postgres' user, so the 2nd line can't give anything unless issued the way the 1st is. -- My way of joking is to tell the truth. That's the funniest joke in the world. -- Muhammad Ali
I don't know what had happened to our test machine, but after I dropped all of the other test databases and reran those commands in the psql console, the user account can log in fine. Strange. On Fri, Jan 21, 2011 at 12:13 PM, Jean-Yves F. Barbier <12ukwn@gmail.com> wrote: > On Fri, 21 Jan 2011 12:01:40 -0500, Mike Thomsen <mikerthomsen@gmail.com> > wrote: > > ... >> psql -U postgres -c "create user miket with password 'miket'" >> createdb testingdb -U postgres >> psql -U postgres -d testingdb -c "create schema testingdb authorization >> miket" psql -U postgres -d testingdb -c "grant all privileges on database >> testingdb to miket" > > I guess that if you used the 1st line you weren't 'postgres' user, so the 2nd > line can't give anything unless issued the way the 1st is. > > -- > My way of joking is to tell the truth. That's the funniest joke in the world. > -- Muhammad Ali > > -- > Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-novice >