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: v2-0001-fix-strchr-strrchr-mistake.patch
Description: v2-0001-fix-strchr-strrchr-mistake.patch

Reply via email to