Drop database/create database broken in 7.4?

From: "John Wells" <jb(at)sourceillustrated(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Drop database/create database broken in 7.4?
Date: 2006-01-05 19:09:02
Message-ID: 50533.66.192.236.118.1136488142.squirrel@devsea.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Guys,

I'm running PG 7.4 on Ubuntu Breezy for Ruby on Rails development. One of
the things I ofter have to do is rebuild the database...for which I have a
script that I've created to do it in one step.

I've noticed some oddities. The script connects to template1, drops the
target database, creates the target database, and the rebuilds the tables.
However, two specific tables and sequences are not dropped, although the
drop command completes successfully.

For example, here's the error reproduced manually:

dailystatus=> \d
List of relations
Schema | Name | Type | Owner
--------+-----------------+----------+--------
public | garages | table | wellsj
public | garages_id_seq | sequence | wellsj
public | trucks | table | wellsj
public | trucks_id_seq | sequence | wellsj
public | sites | table | wellsj
public | sites_id_seq | sequence | wellsj
public | statuses | table | wellsj
public | statuses_id_seq | sequence | wellsj
public | users | table | wellsj
public | users_id_seq | sequence | wellsj
(10 rows)

dailystatus=> \c template1
You are now connected to database "template1".
template1=> drop database dailystatus;
DROP DATABASE
template1=> create database dailystatus;
CREATE DATABASE
template1=> \c dailystatus
You are now connected to database "dailystatus".
dailystatus=> \d
List of relations
Schema | Name | Type | Owner
--------+--------------+----------+--------
public | sites | table | wellsj
public | sites_id_seq | sequence | wellsj
public | users | table | wellsj
public | users_id_seq | sequence | wellsj
(4 rows)

dailystatus=>

Anyone know what might be happening? I'm at a loss.

Thanks!
John

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2006-01-05 19:09:08 Re: Drop database/create database broken in 7.4?
Previous Message Jim Buttafuoco 2006-01-05 19:08:46 Re: Drop database/create database broken in 7.4?