Re: Where is the error - Mailing list pgsql-general

From Kaloyan Iliev Iliev
Subject Re: Where is the error
Date
Msg-id 41D0044A.2070808@faith.digsys.bg
Whole thread Raw
In response to Re: Where is the error  (John DeSoi <desoi@pgedit.com>)
List pgsql-general
Hi again,

When I chage in the dump file

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

ERROR:  syntax error at or near "(" at character 21

 I receive this message. So the question is how to create it without quotes.

Thank in advance:)


Kaloyan


John DeSoi wrote:

>
> 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
>> END
>> '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);
>  int
> -----
>    1
> (1 row)
>
>
> So in this case you probably want to call your function int -- without
> quotes. By default, PostgreSQL folds the names to lowercase.
>
>
> Best,
>
> John DeSoi, Ph.D.
> http://pgedit.com/
> Power Tools for PostgreSQL
>
>

pgsql-general by date:

Previous
From: Andreas Kretschmer
Date:
Subject: Re: Where is the error
Next
From: Kaloyan Iliev Iliev
Date:
Subject: Re: Where is the error