Re: Type definition process (was Re: MemoryContextAlloc: invalid request size 1934906735) - Mailing list pgsql-hackers

From D'Arcy J.M. Cain
Subject Re: Type definition process (was Re: MemoryContextAlloc: invalid request size 1934906735)
Date
Msg-id 20020830012809.80AEF1AFD@druid.net
Whole thread Raw
In response to Re: Type definition process (was Re: MemoryContextAlloc: invalid request size 1934906735)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On August 29, 2002 03:37 pm, Tom Lane wrote:
> "D'Arcy J.M. Cain" <darcy@druid.net> writes:
> > One thing I do see though is that there is a completion issue.
>
> Well, (a) the shell type can't be used for anything till you turn it
> into a real type, and (b) the completion issue already exists, and has
> for a long time; you've always been able to create a shell type by using
> a not-yet-known type name as the return type of a function.  It's just
> not well documented.

And gives a warning, right?

> >  1. An incomplete CREATE TYPE raises an error if not inside a transaction
> > block.
>
> I have no intention of implementing this.  (1) It wouldn't really
> simplify life anyway, since we'd still need all the same guard code to
> prevent you from using the shell type within the creating transaction.
> (2) It would break existing pg_dump scripts, which don't know they'd
> need to do this.

Yes, I see your point.

> Wrapping the sequence inside a transaction is a good practice, but
> I don't feel that we have to try to force good practice on people.

OK but how about a little reward if they do.  Do everything as we do now 
except that if they wrap it in a transaction then they don't get the warning 
unless they exit the transaction without completing the type?  Some people 
(e.g. me) like to code as if warnings were as bad as errors.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: tweaking MemSet() performance
Next
From: "Christopher Kings-Lynne"
Date:
Subject: RULE regression test failure