Re: RfD: more powerful "any" types

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: RfD: more powerful "any" types
Date: 2009-09-09 18:50:27
Message-ID: 20090909185027.GS4132@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> > BTW does "any" match other pseudotypes? Would I be able to pass a
> > cstring into "any"? That would create a large security hole I think.
>
> How so? 'Cause you can do that now with anyelement.

Hmm, it doesn't seem to be allowed?

alvherre=# create function anyelem2 (anyelement) returns int language plpgsql as $$ begin return 1; end $$;
CREATE FUNCTION
alvherre=# select anyelem2(textout('oh'));
ERROR: PL/pgSQL functions cannot accept type cstring
CONTEXTO: compilation of PL/pgSQL function "anyelem2" near line 0

(BTW I find it a bit funny that lines are counted from 0. I never
noticed that before).

> cstring is only a pseudotype for historical reasons, anyway --- there's
> nothing about it now that's not a real type. I think we just have it
> that way to discourage people from storing it in tables.

Wow, it has I/O functions and all. Amazing, I wasn't aware of that.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2009-09-09 18:58:27 Re: More robust pg_hba.conf parsing/error logging
Previous Message David Fetter 2009-09-09 18:40:26 Re: CTE bug?