very concerning, tables hopped from one database to another

From: David Ford <david+cert(at)blue-labs(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: very concerning, tables hopped from one database to another
Date: 2002-04-21 22:22:53
Message-ID: 3CC33BBD.2040402@blue-labs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm a bit anxious at the moment. Things have been going just fine for a
couple months and this afternoon Something Bad (tm) happenend.

Summary. I had 8 databases, I created another one for 9. I started
psql and created a table, created a user, and granted permissions. I
then did a \z to check up on things. Lo and behold, I have 3/4 of the
tables from another database moved into here! I disconnect, reconnect,
yep, still there. I connect to the other database and those tables are
missing. I'm absolutely positive that these tables were in 'hmzbook'
before this. I triple checked and examined a dated pg_dump from a few
days ago and 'hmzbook' was correct.

$ psql -l
Password:
List of databases
Name | Owner
-----------------+-----------
gayladb | gayla
hmzbook | hmz
horde | postgres
pg_auth | postgres
sendmail | mailadmin
sendmailexample | mailadmin
template0 | postgres
template1 | postgres
(8 rows)

$ createdb sysinfo_archive
Password:
CREATE DATABASE

$ psql -d sysinfo_archive
Password:
Welcome to psql, the PostgreSQL interactive terminal.
...

sysinfo_archive=# create table sysinfo ( timestamp timestamp default
'now', host inet not null, component varchar not null, node varchar not
null, identity varchar not null, value int8 default 0 );
CREATE

sysinfo_archive=# insert into sysinfo
(host,component,node,identity,value) values
('1.2.3.4','network','eth0','bytes in','1234');
INSERT 26374 1

sysinfo_archive=# create user mouse with encrypted password 'xxxx';
CREATE USER

sysinfo_archive=# grant select,insert on sysinfo to mouse;
GRANT

sysinfo_archive=# \z
Access privileges for database "sysinfo_archive"
Table | Access privileges
--------------------------+-------------------------------
autthoughts |
guestbook |
guestbook_id_seq |
id_seq |
iquotes |
iquotes_id_seq |
ircfriends |
ircfriends_id_seq |
ircfriendsfriends_id_seq |
picture |
profile |
sysinfo | {=,postgres=arwdRxt,mouse=ar}
temporary |
(13 rows)

What the heck just happened and short of dumping these tables out and
importing them back into the other database...

a) how can I fix this and
b) how can I prevent this from happening again?

Very concerned,
David

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Ford 2002-04-21 22:27:15 (very anxious, tables hopping databases ....)
Previous Message Mike Castle 2002-04-21 21:25:44 Re: Building perl mods pg:PG or DBD:PG on non-PostgreSQLable machines