Re: 8.1 substring bug?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>, Harald Fuchs <hf0923x(at)protecting(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 8.1 substring bug?
Date: 2005-11-11 16:22:37
Message-ID: 19393.1131726157@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> In this particular case the syntax makes it unclear that the substring
> is the problem. Perhaps here the solution would be to put a cast in the
> grammer, like so:

> substr_for: FOR a_expr { $$ =3D makeTypeCast($2,"int4"); }
> ;

Not there, because it would break the variants where FOR introduces a
character expression, eg

<regular expression substring function> ::=
SUBSTRING <left paren> <character value expression> FROM
<character value expression> FOR
<escape character> <right paren>

But I think we could do this in substr_list in the case where we have
just "a_expr substr_for", because there are no variants of that where
the FOR expression is supposed to be string. See my other message
just now.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2005-11-11 17:09:45 Re: someone working to add merge?
Previous Message Tom Lane 2005-11-11 16:07:32 Re: 8.1 substring bug?