RE: SQL statement PREPARE does not work in ECPG - Mailing list pgsql-hackers

From Matsumura, Ryo
Subject RE: SQL statement PREPARE does not work in ECPG
Date
Msg-id 03040DFF97E6E54E88D3BFEE5F5480F737AE118D@G01JPEXMBYT04
Whole thread Raw
In response to Re: SQL statement PREPARE does not work in ECPG  (Michael Meskes <meskes@postgresql.org>)
Responses Re: SQL statement PREPARE does not work in ECPG
List pgsql-hackers
Meskes-san

I'm sorry for my slow reply.

> I agree that we have to accept a quoted statement name and your
> observations are correct of course, I am merely wondering if we need
> the escaped quotes in the call to the ecpg functions or the libpq
> functions.

The following allows to use statement name including white space not double-quoted statement name.

  exec sql prepare "st1 x" from "select 1";

# I don't know whether the existing ECPG allows it intentionally or not.
# In honestly, I think that it's not necessary to allow it.

If we also allow the statement name including white space in PREPRARE AS,
we have to make backend parser to scan it as IDENT.
Double-quoting is one way. There may be another way.

If we want to pass double-quoted statement name to backend through libpq,
preprocessor have to escape it.

> > I would prefer to merge as much as possible, as I am afraid that if
> > we
> > do not merge the approaches, we will run into issues later. There
> > was a
> > reason why we added PQprepare, but I do not remember it from the
> > top of
> > my head. Need to check when I'm online again.
> 
> I will also consider it.

I cannot think of anything.
I may notice if I try to merge.

Regards
Ryo Matsumura

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: C_C_A animal on HEAD gets stuck in initdb
Next
From: Konstantin Knizhnik
Date:
Subject: Re: [HACKERS][Proposal] LZ4 Compressed Storage Manager