BUG #5172: ecpg - cursor with regexp containing '.*/' fails to compile with gcc

From: "Viisard" <viisard(at)hotmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5172: ecpg - cursor with regexp containing '.*/' fails to compile with gcc
Date: 2009-11-07 18:56:36
Message-ID: 200911071856.nA7IuavI066952@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5172
Logged by: Viisard
Email address: viisard(at)hotmail(dot)com
PostgreSQL version: 8.4.1
Operating system: Fedora 11 (Linux 2.6.30.9-96.fc11.i686.PAE)
Description: ecpg - cursor with regexp containing '.*/' fails to
compile with gcc
Details:

I'm using ecpg (PostgreSQL 8.4.1) 4.5.0. It fails to generate valid c file,
when a cursor with a regular expression (in probably could be any string)
containing '*/'.

The line in foo.cpg:
...
EXEC SQL DECLARE foo CURSOR FOR SELECT SUBSTRING('/foo/bar','.*/');
...

is translated into:
foo.c:

/* declare foo cursor for select substring ( '/foo/bar' , '.*/' ) */
#line 9 "foo.cpg"

{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare foo cursor for
select substring ( '/foo/bar' , '.*/' )", ECPGt_EOIT, ECPGt_EORT);}

There is a simple workaround for this by using '.*[/]' as the regexp.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message digital.death@gmx.it 2009-11-08 11:40:13 odd deadlock on CREATE TABLE AS SELECT
Previous Message Peter Eisentraut 2009-11-07 10:23:12 Re: BUG #5171: Composite type with array does not translate in plpythonu