Re: CREATE CAST code review

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: CREATE CAST code review
Date: 2002-07-27 18:05:32
Message-ID: Pine.LNX.4.44.0207252326580.1144-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane writes:

> What about requiring ownership of at least one of the types?

Yes, that would work.

There would be a somewhat bizzare consequence, though: User U1 creates
type T1, user U2 creates type T2. Then user U1 creates a cast from T1 to
T2. Now user U2 would be allowed to drop that cast (unless we store a
cast owner). I guess that lies in the nature of things.

A much more complex yet powerful alternative would be to associate casts
with schemas. For example, this would allow an ordinary user to create a
cast from numeric to text in his own little world. But that might be
going too far.

> > 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,
>
> That is the intention (it's not implemented yet).

My concern was that if you, say, have two schemas and a cast that involves
types from both schemas. If you dump all of them, you have a consistent
dump. But if you dump both schemas separately, do you dump the cast in
both of them (thus making each schema's dump self-contained) or in only
one of them (thus allowing concatenation the dumps). This issue
generalizes to every kind of dependency in pg_dump.

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2002-07-27 18:08:09 Re: CREATE CAST code review
Previous Message Peter Eisentraut 2002-07-27 18:00:33 What exactly does lanispl mean?