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

From Tom Lane
Subject Re: Type definition process (was Re: MemoryContextAlloc: invalid request size 1934906735)
Date
Msg-id 25987.1030649849@sss.pgh.pa.us
Whole thread Raw
In response to Re: Type definition process (was Re: MemoryContextAlloc: invalid request size 1934906735)  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Responses Re: Type definition process (was Re: MemoryContextAlloc: invalid request size 1934906735)
List pgsql-hackers
"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.

>  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.

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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: tweaking MemSet() performance
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] tweaking MemSet() performance