Re: CREATE CAST code review

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: CREATE CAST code review
Дата
Msg-id Pine.LNX.4.44.0207212322320.1144-100000@localhost.localdomain
обсуждение исходный текст
Ответ на CREATE CAST code review  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: CREATE CAST code review  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane writes:

> I looked through your CREATE CAST commit a little.  Looks pretty good
> but I had a few suggestions/concerns.
>
> * The biggie is that I'm not satisfied with the permissions checking.

Me neither.  I had sent a message earlier about this but it went
unnoticed, but I had to implement something that was a little more
restrictive that the previous first come first serve scheme.

> I think I would prefer this definition: to create/drop a cast, you must
> own both datatypes, plus the underlying function if any.  What's the
> rationale for having such a weak permissions scheme?

That doesn't quite work, because then no ordinary user can define a cast
from some built-in type to his own type.  What I'm thinking about is to
implement the USAGE privilege on types, and then you need to have that to
be allowed to create casts.  (Possibly there should be an even more
restrictive privilege invented here, but that would be a second step.)

> * I see that you are worried in pg_dump about which schema to associate
> a cast with, if it's binary-compatible.  I'm confused too; would it work
> to dump the cast iff either of the source/dest datatypes are to be
> dumped?  (This might be a better rule even in the not-binary-compatible
> case.)

I'm not sure about the implications of associating objects with schemas in
pg_dump.  I suppose there might be an option to dump only certain schemas,
in which case it's tricky to associate a cast to any one schema.

> PS: I also want to raise a flag that we still haven't resolved the
> issues we discussed a few months ago, about exactly *which* implicit
> casts should be provided.  I think that's a different thread though.

Yes, I have some thoughts on that which I plan to present soon.

-- 
Peter Eisentraut   peter_e@gmx.net



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Richard Tucker
Дата:
Сообщение: Re: PITR and rollback
Следующее
От: Tom Lane
Дата:
Сообщение: Re: CREATE CAST code review