Re: User Defined Types in Java

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thomas Hallgren <thomas(at)tada(dot)se>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: User Defined Types in Java
Date: 2006-02-09 17:18:37
Message-ID: 20060209171837.GC14852@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 09, 2006 at 09:33:35AM -0500, Tom Lane wrote:
> Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> > Actually, I'm think this whole automatic creation of a shell-type a bit
> > silly anyway. Why not simply solve the problem directly like so:
>
> > CREATE TYPE complex AS SHELL;
>
> One of the unwritten consequences of the way that it works now is that
> only superusers can "clutter the catalogs" with shell types. Not sure
> how important that is, but I suspect that the system is not all that
> robust against use of shell types where a completed type is expected.
> You'd have to go over a lot of code with a fine-tooth comb before
> putting this ability into the hands of ordinary users, else you'd be
> creating loopholes for DOS attacks (or worse).

Would it be reasonable to set this up so you can only create a shell
type within an explicit transaction and that you are required to define
the type completely before commit. That would minimize the exposure to
incomplete types. I don't know if the structure exists to support this
(dynamic on-commit trigger).

> Having said that, I agree that this seems conceptually cleaner, though
> I'm not sure we could ever get rid of the old way because of backward
> compatibility issues.

True. But this way allows us to remove the restriction on only allow C
functions for type input/output.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2006-02-09 17:27:18 Re: pg_hba.conf alternative
Previous Message Tom Lane 2006-02-09 16:58:11 Re: PostgreSQL 8.0.6 crash