Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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

pgsql-hackers by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group