Обсуждение: table name - TypeCreate error

Поиск
Список
Период
Сортировка

table name - TypeCreate error

От
"Felipe Nievinski"
Дата:
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

От
Radu-Adrian Popescu
Дата:
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

От
Tom Lane
Дата:
"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