Re: [HACKERS] Typed table DDL loose ends

2011-04-21 Thread Peter Eisentraut
On Wed, 2011-04-20 at 10:44 -0400, Noah Misch wrote: > If we add that ownership check, we'll protect some operations on the > type. The > cost is localized divergence from our principle that types have no > usage > restrictions. I'm of the opinion that it's not worth introducing that > policy > e

Re: [HACKERS] Typed table DDL loose ends

2011-04-20 Thread Robert Haas
On Wed, Apr 20, 2011 at 10:53 AM, Noah Misch wrote: > On Mon, Apr 18, 2011 at 10:44:53PM +0300, Peter Eisentraut wrote: >> On Sat, 2011-04-09 at 21:57 -0400, Noah Misch wrote: >> > * Inheriting from a typed table blocks further type DDL >> >   CREATE TYPE t AS (x int); >> >   CREATE TABLE parent O

Re: [HACKERS] Typed table DDL loose ends

2011-04-20 Thread Noah Misch
On Mon, Apr 18, 2011 at 10:44:53PM +0300, Peter Eisentraut wrote: > On Sat, 2011-04-09 at 21:57 -0400, Noah Misch wrote: > > * Inheriting from a typed table blocks further type DDL > > CREATE TYPE t AS (x int); > > CREATE TABLE parent OF t; > > CREATE TABLE child () INHERITS (parent); > > A

Re: [HACKERS] Typed table DDL loose ends

2011-04-20 Thread Noah Misch
On Wed, Apr 20, 2011 at 12:26:01AM +0300, Peter Eisentraut wrote: > On Mon, 2011-04-18 at 19:34 -0400, Noah Misch wrote: > > On Mon, Apr 18, 2011 at 10:44:53PM +0300, Peter Eisentraut wrote: > > > On Sat, 2011-04-09 at 21:57 -0400, Noah Misch wrote: > > > > * Users can CREATE TABLE OF on a type the

Re: [HACKERS] Typed table DDL loose ends

2011-04-19 Thread Peter Eisentraut
On Mon, 2011-04-18 at 19:34 -0400, Noah Misch wrote: > On Mon, Apr 18, 2011 at 10:44:53PM +0300, Peter Eisentraut wrote: > > On Sat, 2011-04-09 at 21:57 -0400, Noah Misch wrote: > > > * Users can CREATE TABLE OF on a type they don't own > > > This in turns blocks the owner's ability to alter the ta

Re: [HACKERS] Typed table DDL loose ends

2011-04-18 Thread Noah Misch
On Mon, Apr 18, 2011 at 10:44:53PM +0300, Peter Eisentraut wrote: > On Sat, 2011-04-09 at 21:57 -0400, Noah Misch wrote: > > * Users can CREATE TABLE OF on a type they don't own > > This in turns blocks the owner's ability to alter the table/type. However, > > we > > already have this hazard with

Re: [HACKERS] Typed table DDL loose ends

2011-04-18 Thread Peter Eisentraut
On Sat, 2011-04-09 at 21:57 -0400, Noah Misch wrote: > * Table row types used in typed tables vs. ALTER TABLE This item was addressed, but the other ones were not, I think. > * Inheriting from a typed table blocks further type DDL > CREATE TYPE t AS (x int); > CREATE TABLE parent OF t; > CR

Re: [HACKERS] Typed table DDL loose ends

2011-04-18 Thread Robert Haas
On Mon, Apr 18, 2011 at 11:46 AM, Tom Lane wrote: > Robert Haas writes: >> On Mon, Apr 18, 2011 at 11:33 AM, Tom Lane wrote: >>> What about inverting the message phrasing, ie >>> >>> ERROR: type stuff must not be a table's row type > >> It also can't be a view's row type, a sequence's row type,

Re: [HACKERS] Typed table DDL loose ends

2011-04-18 Thread Tom Lane
Robert Haas writes: > On Mon, Apr 18, 2011 at 11:33 AM, Tom Lane wrote: >> What about inverting the message phrasing, ie >> >> ERROR: type stuff must not be a table's row type > It also can't be a view's row type, a sequence's row type, a foreign > table's row type... Well, you could say "rela

Re: [HACKERS] Typed table DDL loose ends

2011-04-18 Thread Robert Haas
On Mon, Apr 18, 2011 at 11:33 AM, Tom Lane wrote: > Robert Haas writes: >> On Mon, Apr 18, 2011 at 10:48 AM, Noah Misch wrote: >>> FWIW, the term "stand-alone composite type" appears twice in our >>> documentation. > >> Hmm, OK.  Anyone else have an opinion on the relative merits of: > >> ERROR

Re: [HACKERS] Typed table DDL loose ends

2011-04-18 Thread Tom Lane
Robert Haas writes: > On Mon, Apr 18, 2011 at 10:48 AM, Noah Misch wrote: >> FWIW, the term "stand-alone composite type" appears twice in our >> documentation. > Hmm, OK. Anyone else have an opinion on the relative merits of: > ERROR: type stuff is not a composite type > vs. > ERROR: type stu

Re: [HACKERS] Typed table DDL loose ends

2011-04-18 Thread Robert Haas
On Mon, Apr 18, 2011 at 10:48 AM, Noah Misch wrote: > On Mon, Apr 18, 2011 at 10:20:21AM -0400, Robert Haas wrote: >> I tweaked the comments accordingly, and also reverted your change to >> the error message, because I don't want to introduce new terminology >> here that we're not using anywhere e

Re: [HACKERS] Typed table DDL loose ends

2011-04-18 Thread Noah Misch
On Mon, Apr 18, 2011 at 10:20:21AM -0400, Robert Haas wrote: > I tweaked the comments accordingly, and also reverted your change to > the error message, because I don't want to introduce new terminology > here that we're not using anywhere else. FWIW, the term "stand-alone composite type" appears

Re: [HACKERS] Typed table DDL loose ends

2011-04-18 Thread Robert Haas
On Thu, Apr 14, 2011 at 9:38 PM, Noah Misch wrote: > On Thu, Apr 14, 2011 at 11:23:49AM -0700, Robert Haas wrote: >> On Thu, Apr 14, 2011 at 5:18 AM, Noah Misch wrote: >> >> I guess my gut feeling is that it would make more sense to forbid it >> >> outright for 9.1, and we can look at relaxing th

Re: [HACKERS] Typed table DDL loose ends

2011-04-14 Thread Noah Misch
On Thu, Apr 14, 2011 at 11:23:49AM -0700, Robert Haas wrote: > On Thu, Apr 14, 2011 at 5:18 AM, Noah Misch wrote: > >> I guess my gut feeling is that it would make more sense to forbid it > >> outright for 9.1, and we can look at relaxing that restriction later > >> if we're so inclined. > >> > >>

Re: [HACKERS] Typed table DDL loose ends

2011-04-14 Thread Robert Haas
On Thu, Apr 14, 2011 at 5:18 AM, Noah Misch wrote: >> I guess my gut feeling is that it would make more sense to forbid it >> outright for 9.1, and we can look at relaxing that restriction later >> if we're so inclined. >> >> Much as with the problem Tom fixed in commit >> eb51af71f241e8cb199790de

Re: [HACKERS] Typed table DDL loose ends

2011-04-14 Thread Noah Misch
On Wed, Apr 13, 2011 at 07:57:29PM -0700, Robert Haas wrote: > On Sat, Apr 9, 2011 at 6:57 PM, Noah Misch wrote: > > While looking at the typed table/pg_upgrade problem, I ran into a few > > smaller > > problems in the area. ?I'm not envisioning a need for much code shift to fix > > them, but the

Re: [HACKERS] Typed table DDL loose ends

2011-04-13 Thread Robert Haas
On Sat, Apr 9, 2011 at 6:57 PM, Noah Misch wrote: > While looking at the typed table/pg_upgrade problem, I ran into a few smaller > problems in the area.  I'm not envisioning a need for much code shift to fix > them, but there are a few points of policy. > > * Table row types used in typed tables

[HACKERS] Typed table DDL loose ends

2011-04-09 Thread Noah Misch
While looking at the typed table/pg_upgrade problem, I ran into a few smaller problems in the area. I'm not envisioning a need for much code shift to fix them, but there are a few points of policy. * Table row types used in typed tables vs. ALTER TABLE As previously noted: CREATE TABLE t ();