Re: A maybe-bug?

From: Russell Smith <mr-russ(at)pws(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>, pgsql-general(at)postgresql(dot)org
Subject: Re: A maybe-bug?
Date: 2010-01-07 23:34:56
Message-ID: 4B466FA0.2020906@pws.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it> writes:
>
>> I tried this:
>> tmp1=# CREATE DOMAIN real as numeric;
>> [ and got confused between this domain and the built-in "real" ]
>>
>
>
>> It looks like to me this is a bug and also the documentation seems to confirm:
>> "The domain name must be unique among the types and domains existing
>> in its schema."
>>
>
> No bug. The REAL keyword is treated as an alias for pg_catalog.float4,
> but even if it weren't an alias, it would exist in schema pg_catalog.
> Thus there is not a name conflict with your domain, which (I suppose)
> was created in the "public" schema.
>
> regards, tom lane
>
>
Really, I can't see how quoting an identifier should change the
behaviour or resolved type. In the non-quoted version it uses the
pg_catalog.float4 and in the quoted version it uses the domain. This
doesn't seem right at all. I would have expected it would reject both
t1 and t2 inserts on the basic real and "real" both map to
pg_catalog.float4. The documentation indicates that pg_catalog is
always searched first. If it is, the domain from public should always
use the pg_catalog version.

Russell

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-01-07 23:46:16 Re: A maybe-bug?
Previous Message Greg Smith 2010-01-07 21:31:14 Re: pg.dropped