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

Re: Where is the error

From: Andreas Kretschmer <andreas_kretschmer(at)despammed(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Where is the error
Date: 2004-12-27 12:31:53
Message-ID: pub5a2-f64.ln1@kaufbach.delug.de (view raw or flat)
Thread:
Lists: pgsql-general
begin  Kaloyan Iliev Iliev <news1(at)faith(dot)digsys(dot)bg> wrote:
> Hi
>  I have the following function:

> CREATE OR REPLACE FUNCTION "int" (boolean) RETURNS integer AS'

I'm not sure. But 'int' is reserved, possibly is this the error.

CREATE OR REPLACE FUNCTION my_int (boolean) RETURNS integer AS'
select CASE WHEN $1 THEN 1
ELSE 0
END
'LANGUAGE 'sql';

test_db=# select my_int('t'::bool);
 my_int
--------
      1
(1 Zeile)



end
Regards, Andreas
-- 
Diese Message wurde erstellt mit freundlicher Unterstützung eines freilau-
fenden Pinguins aus artgerechter Freilandhaltung.   Er ist garantiert frei
von Micro$oft'schen Viren. (#97922 http://counter.li.org)     GPG 7F4584DA
Was, Sie wissen nicht, wo Kaufbach ist? Hier: N 51.05082°, E 13.56889° ;-)

In response to

pgsql-general by date

Next:From: Kaloyan Iliev IlievDate: 2004-12-27 12:47:06
Subject: Re: Where is the error
Previous:From: Kaloyan Iliev IlievDate: 2004-12-27 12:30:56
Subject: Re: Where is the error

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