X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6D7EFD1B1D0 for ; Wed, 30 Jun 2004 01:45:10 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 25867-04 for ; Wed, 30 Jun 2004 04:45:07 +0000 (GMT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id AE77DD1B1A0 for ; Wed, 30 Jun 2004 01:45:06 -0300 (ADT) Received: from [192.168.4.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 1884077; Tue, 29 Jun 2004 21:37:05 -0700 Message-ID: <40E24551.3080606@joeconway.com> Date: Tue, 29 Jun 2004 21:45:05 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Jean-Denis Giguere , pgsql-admin@postgresql.org Subject: Re: grant execute on many functions References: <40E1E1A9.8080207@fastmail.fm> <40E1ECEF.5090007@joeconway.com> <3318.1088567114@sss.pgh.pa.us> <40E23F72.4000108@joeconway.com> <3719.1088569577@sss.pgh.pa.us> In-Reply-To: <3719.1088569577@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/390 X-Sequence-Number: 14050 Tom Lane wrote: > Um. Sooner or later we ought to do something about the whole > automatic-casting-to-and-from-text issue. Datatypes shouldn't have to > supply both I/O procedures and text cast procedures. I thought automatic (i.e. implicit) casting-to-and-from-text was a no-no because it could cause strange and unintended conversion to take place, no? I do believe that explict casting to text should be allowed -- the result of any OUT function can be represented as text, can't it? A C-language version of the following should do it: create or replace function any2text(anyelement) returns text as ' begin return $1; end; ' language plpgsql; And if we could cast text to cstring, it could be the input of any IN function. Hmmm, I guess you can cast any literal to cstring though: select int4in('1'::cstring); int4in -------- 1 (1 row) > Right, in the short term you can make it work inside a plpgsql function, > since plpgsql is pretty darn lax about casting. But it'd be nice if it > worked more generally. > So what would that look like, and still be "safe". Joe