Thread: I can be a BUG?

I can be a BUG?

From
"Edipo E. F. Melo"
Date:
Hi all,

    My wife is working on a university graduate project with PHP
and PostgreSQL. She used ERWin to model the tables and exported the
model into ASCII file with a set of SQL commands to create the tables
(with a short corrections of types).

    Whe she tried to import into PostgreSQL, using pgsql and "\i"
command, it create about 95% of the tables. The others wasn't created
because she forgot change the type of some fields.

    To delete the tables, I sugest to drop the database and create
it again. She droped the database and, when she created the new one,
all tables was there. We repeat this process some times and it can't
create a empty database.

    Even on a new, uncreated, with another name, database, all the
tables of the problematic database was there. Can anyone explain if we
are making somethink wrong or this is a BUG?

    We using PostgreSQL 7.0.3. under Conectiva Linux 5.0. I'm
sending the ASCII script attached.

PS.: Sara, sorry if you receive more than one copy of this mensage, but
I was uncertain about you correct e-mail address.

    Thank's and "Feliz Natal" to all,


    []'s

    Edipo Elder F. de Melo

Attachment

Re: I can be a BUG?

From
Tom Lane
Date:
It kinda sounds like your wife created those tables in template1.

Duplicating template1's contents into new databases isn't a bug,
it's a feature ;-)

You can get rid of the tables by manually deleting them in template1.
However, if you don't have any useful data in the installation at all,
an initdb would be easier...
        regards, tom lane


Re: I can be a BUG?

From
Roberto Mello
Date:
Tom Lane wrote:
> 
> It kinda sounds like your wife created those tables in template1.
> 
> Duplicating template1's contents into new databases isn't a bug,
> it's a feature ;-)
I've seen this behaviour too. Yesterday I pg_dumpall my 7.01 db
compiled from scratch and loaded in PG 7.02 installed from Debian
packages (I know a pg_dumpall wasn't needed, but I did it anyway).When I went into psql, I was some of my databases
withall the pg_*
 
tables. Why? Also, if I dropdb the database and createdb it again, it's
as if I never deleted it. Is that normal/bug/feature? Why?
-Roberto

P.S: It's nice to see some Brazilians on the list :) I am from Brazil
too. I hope Conectiva is promoting PostgreSQL down there.
-- 
Computer Science            Utah State University
Space Dynamics Laboratory        Web Developer
USU Free Software & GNU/Linux Club     http://fslc.usu.edu
My home page - http://www.brasileiro.net/roberto


Re: I can be a BUG?

From
"Ross J. Reedstrom"
Date:
On Fri, Dec 01, 2000 at 04:25:36PM -0700, Roberto Mello wrote:
> Tom Lane wrote:
> > 
> > It kinda sounds like your wife created those tables in template1.
> > 
> > Duplicating template1's contents into new databases isn't a bug,
> > it's a feature ;-)
> 
>     I've seen this behaviour too. Yesterday I pg_dumpall my 7.01 db
> compiled from scratch and loaded in PG 7.02 installed from Debian
> packages (I know a pg_dumpall wasn't needed, but I did it anyway).
>     When I went into psql, I was some of my databases with all the pg_*
> tables. Why? Also, if I dropdb the database and createdb it again, it's
> as if I never deleted it. Is that normal/bug/feature? Why?
> 

Ah, the Debian PostgreSQL package uses a different default convention with
psql than a from source compile: if you don't provide a database name,
debian psql will connect you to template1. On a from source compile,
it'll try to connect to a database that matches your username.

Ross


Re: I can be a BUG?

From
Roberto Mello
Date:
"Ross J. Reedstrom" wrote:

> >       When I went into psql, I was some of my databases with all the pg_*
> > tables. Why? Also, if I dropdb the database and createdb it again, it's
> > as if I never deleted it. Is that normal/bug/feature? Why?
> >
> 
> Ah, the Debian PostgreSQL package uses a different default convention with
> psql than a from source compile: if you don't provide a database name,
> debian psql will connect you to template1. On a from source compile,
> it'll try to connect to a database that matches your username.Bit I did specify my database name.
-Roberto
-- 
Computer Science            Utah State University
Space Dynamics Laboratory        Web Developer
USU Free Software & GNU/Linux Club     http://fslc.usu.edu
My home page - http://www.brasileiro.net/roberto


Re: I can be a BUG?

From
"Edipo E. F. Melo"
Date:
On Fri, 01 Dec 2000 18:00:42 -0500, Tom Lane wrote:

>It kinda sounds like your wife created those tables in template1.
>
>Duplicating template1's contents into new databases isn't a bug,
>it's a feature ;-)
That's it! I didn't see she created on template1 and on project
database too. Thank's for help!

   []'s
   Edipo Elder F. de Melo