Subject: [PATCH] Allow catalogname (database) and procname （no under public schema) enumeration with SQLProcedures

From: 刘庄 <[email-masked]>
Date: Tue, 10 Oct 2023 13:09:01 +0800 (CST)

hello！

The attached patch fixed  SQLProcedures two bug:

1.  make enumeration of databases (catalogs in ODBC speak) work.

2.  make enumeration of procedurename (procname  in ODBC speak) work.

Step:

   1.  login postgres

   2.  create schem named  schem1 

   3.  set search_path TO schem1

   4.  create procedure named genre_insert_data

   5.  with odbc application（retcode =  SQLProcedures (hstmt, NULL, 0, NULL, 0, (SQLCHAR *)"genre_insert_data", strlen("genre_insert_data"));）to get the genre_insert_data(step 4)

   6.  the result is empty.

   7. After the patch is compiled using the attached patch, then run the odbc application（step 5）, The result is shown below:

---

From: Dave Cramer <[email-masked]>
Date: Tue, 10 Oct 2023 09:04:31 -0400

Hello,

Thanks for the patch, however it does not apply cleanly using patch or git
apply

Can you provide a PR postgresql-interfaces/psqlodbc (github.com)
<https://github.com/postgresql-interfaces/psqlodbc> and add tests please ?

Dave Cramer
www.postgres.rocks

On Tue, 10 Oct 2023 at 01:09, 刘庄 <[email-masked]> wrote:

>    5.  with odbc application（retcode =  SQLProcedures (hstmt, NULL, 0,
> NULL, 0, (SQLCHAR *)"genre_insert_data", strlen("genre_insert_data"));）to
> get the genre_insert_data(step 4)
>
>    6.  the result is empty.
>
>    7. After the patch is compiled using the attached patch, then run the odbc
> application（step 5）, The result is shown below:
>
>
>
>
>
>

---

From: 刘庄 <[email-masked]>
Date: Wed, 11 Oct 2023 20:16:18 +0800 (CST)

hello  Dave Cramer:

 I'm sorry that my access to github is very unstable.
 I will send you the source code change file(info-patch.c) and added test cases first(catalogfunctions-test.c， sampletables.sql).
 I will submit a PR postgresql-interfaces/psqlodbc (github.com)  when my network is stable.

This patch has been verified in my local environment   can make enumeration of databases and procedurename work. The verification results are as follows:
 OS vesion:                CentOS7 3.10.0-957.el7.x86_64
 PG server version:    PostgreSQL 14.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
 psqlODBC version:    psqlodbc-15.00.0000
 unixODBC version:    unixODBC 2.3.1
 The regression (with added test cases) result:
                  With no path: is empty.
 
                 With the attached patch： SQLProcedures work well

Regards,

     Liu Zhuang

At 2023-10-10 21:04:31, "Dave Cramer" <[email-masked]> wrote:

Hello,

Thanks for the patch, however it does not apply cleanly using patch or git apply

Can you provide a PR postgresql-interfaces/psqlodbc (github.com) and add tests please ?

Dave Cramer
www.postgres.rocks

hello！

Step:

   1.  login postgres

   6.  the result is empty.