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

Re: Where is the error

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Kaloyan Iliev Iliev <news1(at)faith(dot)digsys(dot)bg>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Where is the error
Date: 2004-12-27 12:20:43
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Dec 27, 2004, at 6:42 AM, Kaloyan Iliev Iliev wrote:

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

The problem is that you have quoted the function name as "int". You 
should only do this when you want to force the exact case of the name. 
When you do it this way, you have to use double quotes when you refer 
to the identifier:

select "int"('t'::boolean);
(1 row)

So in this case you probably want to call your function int -- without 
quotes. By default, PostgreSQL folds the names to lowercase.


John DeSoi, Ph.D.
Power Tools for PostgreSQL

In response to


pgsql-general by date

Next:From: Marek LewczukDate: 2004-12-27 12:25:55
Subject: Re: Where is the error
Previous:From: Martijn van OosterhoutDate: 2004-12-27 12:07:07
Subject: Re: Get current trasanction id

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