// In connection.h typedef struct // ... existing fields char my_new_param[256]; // new parameter int my_new_feature_enabled; ConnectionInfo_; // In connection.c - parse connection string static int parse_connection_string(ConnectionInfo_ *ci, const char *conn_str) // ... existing parsing code
// In prepared.c typedef struct StatementCacheEntry char *statement_name; char *sql; PGresult *prepared_result; time_t last_used; int use_count; struct StatementCacheEntry *next; StatementCacheEntry; static StatementCacheEntry *statement_cache = NULL;
entry->statement_name = strdup(name); entry->sql = strdup(sql); entry->last_used = time(NULL); entry->use_count = 1; entry->next = statement_cache;
curr = curr->next;
return NULL;
// In convert.c SQLRETURN convert_jsonb_to_c( const char *value, SQLSMALLINT target_type, void *target_value, SQLLEN *target_len)
Build Environment # Clone the repository git clone https://github.com/postgres/postgresql-odbc.git cd postgresql-odbc Configure with debug options ./configure --enable-debug --enable-unicode CFLAGS="-g -O0" Build make clean make make install Testing Your Feature // Add test in test/test_feature.c void test_new_connection_parameter() SQLHDBC hdbc; SQLRETURN ret; // Test connection with new parameter ret = SQLConnect(hdbc, (SQLCHAR*)"DSN=PostgreSQL;MyNewFeature=1", SQL_NTS, NULL, 0, NULL, 0);
Postgresql-odbc May 2026
// In connection.h typedef struct // ... existing fields char my_new_param[256]; // new parameter int my_new_feature_enabled; ConnectionInfo_; // In connection.c - parse connection string static int parse_connection_string(ConnectionInfo_ *ci, const char *conn_str) // ... existing parsing code
// In prepared.c typedef struct StatementCacheEntry char *statement_name; char *sql; PGresult *prepared_result; time_t last_used; int use_count; struct StatementCacheEntry *next; StatementCacheEntry; static StatementCacheEntry *statement_cache = NULL; postgresql-odbc
entry->statement_name = strdup(name); entry->sql = strdup(sql); entry->last_used = time(NULL); entry->use_count = 1; entry->next = statement_cache; // In connection
curr = curr->next;
return NULL;
// In convert.c SQLRETURN convert_jsonb_to_c( const char *value, SQLSMALLINT target_type, void *target_value, SQLLEN *target_len) // new parameter int my_new_feature_enabled
Build Environment # Clone the repository git clone https://github.com/postgres/postgresql-odbc.git cd postgresql-odbc Configure with debug options ./configure --enable-debug --enable-unicode CFLAGS="-g -O0" Build make clean make make install Testing Your Feature // Add test in test/test_feature.c void test_new_connection_parameter() SQLHDBC hdbc; SQLRETURN ret; // Test connection with new parameter ret = SQLConnect(hdbc, (SQLCHAR*)"DSN=PostgreSQL;MyNewFeature=1", SQL_NTS, NULL, 0, NULL, 0);