Skip site navigation (1) Skip section navigation (2)

Re: Type definition process (was Re: MemoryContextAlloc: invalid request size 1934906735)

From: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(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: Type definition process (was Re: MemoryContextAlloc: invalid request size 1934906735)
Date: 2002-08-30 01:28:08
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On August 29, 2002 03:37 pm, Tom Lane wrote:
> "D'Arcy J.M. Cain" <darcy(at)druid(dot)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(at){druid|vex}.net>   |  Democracy is three wolves                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.

In response to

pgsql-hackers by date

Next:From: Joe ConwayDate: 2002-08-30 01:29:45
Subject: Re: SRF memory mgmt patch
Previous:From: Tatsuo IshiiDate: 2002-08-30 01:25:48
Subject: Re: SRF memory mgmt patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group