[pgsql-jp: 34308] Re: データベースが存在するのに、「存在しない」と言われる

Yukie Oshima sanoyuki @ ninus.ocn.ne.jp
2004年 11月 20日 (土) 15:28:58 JST


質問者の大島です。
いろいろと手がかりをどうもありがとうございます。
みなさんの手がかりで、この動作がとてもおかしいということが
よくわかりました。

あれから、再インストールをしたのですが、もとの状態は変わらず
のこってしまっています。そして drop できないのもかわりません。

なにかがおかしくなってしまったようですが、原因が特定できません。

複数の postmaster が起動しているわけでもなさそです。
そして、$PGDATA の .pid ファイルを削除してもやはり drop できませんでした。
以下に、現状をためしている ログをはりつけます。また何かお気づきの点があって
ご指摘いただけると幸いです。

[postgres @ fedora data]$ whoami
postgres
[postgres @ fedora data]$ ps -ef | grep postmaster
postgres 3452 1 0 15:17 ? 00:00:00 ./postmaster
postgres 3479 3281 0 15:25 pts/1 00:00:00 grep postmaster
[postgres @ fedora data]$ psql -l
List of databases
Name | Owner | Encoding
-----------+----------+-----------
cart04 | | EUC_JP
cart04 | | EUC_JP
cart04_01 | | EUC_JP
template0 | postgres | SQL_ASCII
template1 | postgres | SQL_ASCII
test | postgres | SQL_ASCII
(6 rows)

[postgres @ fedora data]$ psql temlpate1
psql: FATAL: database "temlpate1" does not exist
[postgres @ fedora data]$ psql template1
Welcome to psql 7.4.6, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

template1=# select * from pg_database;
datname | datdba | encoding | datistemplate | datallowconn |
datlastsysoid | datvacuumxid | datfrozenxid | datpath | datconfig | datacl
-----------+--------+----------+---------------+--------------+---------------+--------------+--------------+---------+-----------+--------------------------
cart04 | 100 | 1 | f | t | 17140 | 464 | 464 | | |
cart04 | 100 | 1 | f | t | 17140 | 464 | 464 | | |
test | 1 | 0 | f | t | 17140 | 464 | 464 | | |
template1 | 1 | 0 | t | t | 17140 | 464 | 464 | | | {postgres=C*T*/postgres}
template0 | 1 | 0 | t | f | 17140 | 464 | 464 | | | {postgres=C*T*/postgres}
cart04_01 | 100 | 1 | f | t | 17140 | 464 | 464 | | |
(6 rows)

template1=# drop database cart04;
ERROR: database "cart04" doesn't exist despite earlier reports to the
contrary
template1=#
template1=# \q
[postgres @ fedora data]$
[postgres @ fedora data]$
[postgres @ fedora data]$ ls
PG_VERSION base global pg_clog pg_hba.conf pg_ident.conf pg_xlog
postgresql.conf postmaster.opts postmaster.pid
[postgres @ fedora data]$ cd ..
[postgres @ fedora pgsql]$ ls
bin data doc include lib man share
[postgres @ fedora pgsql]$ ./bin/pg_ctl stop
waiting for postmaster to shut down......done
postmaster successfully shut down
[postgres @ fedora pgsql]$ ls
bin data doc include lib man share
[postgres @ fedora pgsql]$ cd data
[postgres @ fedora data]$ ls
PG_VERSION base global pg_clog pg_hba.conf pg_ident.conf pg_xlog
postgresql.conf postmaster.opts
[postgres @ fedora data]$ cd ..
[postgres @ fedora pgsql]$ ls
bin data doc include lib man share
[postgres @ fedora pgsql]$ ./bin/pg_ctl start
postmaster successfully started
[postgres @ fedora pgsql]$ ls
bin data doc include lib man share
[postgres @ fedora pgsql]$ cd data
[postgres @ fedora data]$ ls
PG_VERSION base global pg_clog pg_hba.conf pg_ident.conf pg_xlog
postgresql.conf postmaster.opts postmaster.pid
[postgres @ fedora data]$ dropdb cart04
dropdb: database removal failed: ERROR: database "cart04" doesn't exist
despite earlier reports to the contrary
[postgres @ fedora data]$

以上です。宜しくお願い致します。



hanrin wrote:

>>と言うことは、そのスーパーユーザーでcreatedbするわけですから
>>Ownerはpostgresになると思いますが?
>>しかもそのpostgresからはアクセス出来る筈では?
>>違ってますでしょうか?????
>>    
>>
>
>間違っていません。
>しかし、dbのスーパーユーザーはデータベースに関するすべての権限を有する
>はずですから、DROP DATABASEできないのはおかしいです。
>
>複数のpostmasterが起動している(システムに最初から入っているものと、後
>からインストールしたもの)か、$PGDATAにpidファイルが残っているか、だと
>思います。
>
>
>
>
>
>
>  
>




pgsql-jp メーリングリストの案内