RE: parse mistake in ecpg connect string - Mailing list pgsql-hackers

From kuroda.hayato@fujitsu.com
Subject RE: parse mistake in ecpg connect string
Date
Msg-id OSBPR01MB31573F75BE36C7EF89348AF8F58F9@OSBPR01MB3157.jpnprd01.prod.outlook.com
Whole thread Raw
In response to parse mistake in ecpg connect string  ("Wang, Shenhao" <wangsh.fnst@cn.fujitsu.com>)
List pgsql-hackers
Dear Wang,

> the value tmp2 will always be NULL, the unix-socket path will be ignored.

I confirmed it, you're right.

> I have fixed this problem, the patch attached.

It looks good to me:-).

> I will try to fix this problem later, but it seems a little difficult to add some lex/bison file rules

I think rule `connection_target` must be fixed.
Either port or unix_socket_directory can be accepted now(I followed the comment),
but we should discuss about it.
According to the doc, libpq's connection-URI accept both.

The attached patch contains all fixes, and pass test in my environment.
And the following line:

  EXEC SQL CONNECT TO unix:postgresql://localhost:/a:/postgres;

is precompiled to:

  { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:/a:/postgres" , NULL, NULL , NULL, 0); }

Is it OK?

Best Regards,
Hayato Kuroda
FUJITSU LIMITED


Attachment

pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: parse mistake in ecpg connect string
Next
From: "kuroda.hayato@fujitsu.com"
Date:
Subject: RE: parse mistake in ecpg connect string