Thread: table name - TypeCreate error

table name - TypeCreate error

From
"Felipe Nievinski"
Date:
Hi.

Please, I would like to know why I can't create a table with a name 
equal of a type name.

For example, when a try this:CREATE TABLE time (id int);
I get the following error message:ERROR:  TypeCreate: type time already defined

I would expect to be able to create a table with any name different 
than others tables' name.

Thank you in advance,
Felipe.




Re: table name - TypeCreate error

From
Radu-Adrian Popescu
Date:
On Thu, 2002-01-24 at 15:20, Felipe Nievinski wrote:
> Hi.
> 
> Please, I would like to know why I can't create a table with a name 
> equal of a type name.
> 
> For example, when a try this:
>     CREATE TABLE time (id int);
> I get the following error message:
>     ERROR:  TypeCreate: type time already defined
> 
> I would expect to be able to create a table with any name different 
> than others tables' name.
> 
> Thank you in advance,
> Felipe.
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

teamsheet=# CREATE TABLE "time" (id int);
ERROR:  type named time already exists
teamsheet=# CREATE TABLE "Time" (id int);
CREATE

:-)

-- 



Radu-Adrian Popescu
CSA, DBA, Programmer



Re: table name - TypeCreate error

From
Tom Lane
Date:
"Felipe Nievinski" <fnievinski@terra.com.br> writes:
> I would expect to be able to create a table with any name different 
> than others tables' name.

A table also implies a type (for its rowtype) in Postgres.  Sorry.

In 7.3 this will be less of a problem since user tables will live in
a different schema than system types do.  For now, there's nothing
you can do except name your table something else.
        regards, tom lane