Re: proposal: regrole type? - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal: regrole type?
Date
Msg-id CAFj8pRAVPnqPScOBVz-k7d0V+MSSitU4QKyTDpkAca6gwK7vUw@mail.gmail.com
Whole thread Raw
In response to Re: proposal: regrole type?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: proposal: regrole type?  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
2012/12/25 Tom Lane <tgl@sss.pgh.pa.us>:
> Pavel Stehule <pavel.stehule@gmail.com> writes:
>> * We can reduce to half lot of functions \df has_* (84 functions)
>
> Not without breaking existing queries.  A function taking regrole might
> look like it substitutes for one taking a text-string user name as long
> as you only pass literal constants to it, but as soon as you pass
> non-constants you'll find out different.  (Unless your plan is to also
> create an implicit cast from text to regrole, which strikes me as a
> seriously bad idea.)

understand

>
> The reason we've not been more aggressive about using the OID-alias
> pseudotypes is exactly that they're not a cure-all.

yes, I agree. But this type can has sense without propagation to
current functionality - and current functions can be marked as
obsolete in future. I believe so it can clean little bit this are -
mainly can solve task, where can be used pseudo role "public" and it
is more accurate and semantic design and can be used in new functions
and system views.
 Otherwise we would
> already have about a dozen more of them.  I don't think it's really
> worth it: the notational savings is pretty marginal and the impact on
> application namespace should not be ignored.  (Keep in mind that any new
> system type causes problems for similarly-named user tables.)

9.3 has no problem

postgres=# create table regtype(a int);
CREATE TABLE

postgres=# create table regclass(a int);
CREATE TABLE

Regards

Pavel

>
>                         regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: proposal: regrole type?
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: regrole type?