Re: HEAD \df doesn't show functions with no arguments

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: HEAD \df doesn't show functions with no arguments
Date: 2005-04-01 05:37:05
Message-ID: 20050401053705.GA53134@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers pgsql-patches

On Fri, Apr 01, 2005 at 12:08:21AM -0500, Bruce Momjian wrote:
> Tom Lane wrote:
> >
> > What makes you think you can't call 'em from SQL?
> >
> > regression=# select int4in('345');
> > int4in
> > --------
> > 345
> > (1 row)
>
> Yes, I guess I mean does it make sense to call them from SQL? Their
> purpose is for internal use, no?

I've used them to effect a cast where one wasn't defined; that might
not be desirable for general use, but it can be handy for quick-n-dirty.
For example, there's no standard cast from bit or varbit to text,
but you can do it with the I/O functions:

CREATE TABLE foo (b varbit, t text);
INSERT INTO foo (b) VALUES (B'10101101');
UPDATE foo SET t = textin(bit_out(b));
SELECT * FROM foo;
b | t
----------+----------
10101101 | 10101101
(1 row)

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Fuhr 2005-04-01 05:46:06 Re: HEAD \df doesn't show functions with no arguments
Previous Message Bruce Momjian 2005-04-01 05:32:51 Re: HEAD \df doesn't show functions with no arguments

Browse pgsql-patches by date

  From Date Subject
Next Message Michael Fuhr 2005-04-01 05:46:06 Re: HEAD \df doesn't show functions with no arguments
Previous Message Bruce Momjian 2005-04-01 05:32:51 Re: HEAD \df doesn't show functions with no arguments