Re: Add hint for function named "is"

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add hint for function named "is"
Date: 2016-08-11 21:32:29
Message-ID: 57F2278E-CD67-4287-B323-8EF2984551A7@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Aug 11, 2016, at 2:11 PM, Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com> wrote:

> CREATE FUNCTION pg_temp.is() RETURNS text LANGUAGE sql AS $$SELECT 'x'::text$$;
> SELECT 'x'||is();
> ERROR: syntax error at or near "("
> LINE 1: SELECT 'x'||is();
>
> I was finally able to figure out this was because "is" needs to be quoted; is there a way this could be hinted?
>
> FWIW, the real-world case here comes from using pgTap, which has an is() function. I've used that countless times by itself without quoting, so it never occurred to me that the syntax error was due to lack of quotes.

Why does it need quotation marks in this case?

D

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-08-11 21:47:42 condition variables
Previous Message M Enrique 2016-08-11 21:25:26 Re: Allowing GIN array_ops to work on anyarray