Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/binary-gems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: ${{ matrix.ruby }}
apt-get: "postgresql" # Ubuntu
apt-get: "postgresql postgresql-server-dev-all" # Ubuntu
brew: "postgresql" # macOS
mingw: "postgresql" # Windows mingw / mswin /ucrt

Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/source-gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,14 @@ jobs:
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main $PGVER" | sudo tee -a /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get -y update
sudo apt-get -y --allow-downgrades install postgresql-$PGVER libpq5=$PGVER* libpq-dev=$PGVER*
sudo apt-get -y --allow-downgrades install postgresql-$PGVER libpq5=$PGVER* libpq-dev=$PGVER* postgresql-server-dev-$PGVER libkrb5-dev
echo /usr/lib/postgresql/$PGVER/bin >> $GITHUB_PATH
- name: Download OAuth support Ubuntu
if: matrix.os == 'ubuntu' && matrix.PGVER >= 18
run: |
sudo apt-get -y --allow-downgrades install libpq-oauth=$PGVER*
- name: Download PostgreSQL Macos
if: matrix.os == 'macos'
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
/lib/2.?/
/lib/3.?/
/pkg/
/spec/oauth/*.bc
/spec/oauth/*.o
/spec/oauth/*.so
/tmp/
/tmp_test_*/
/vendor/
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ group :test do
gem "rake-compiler", "~> 1.0"
gem "rake-compiler-dock", "~> 1.11.0" #, git: "https://github.com/rake-compiler/rake-compiler-dock"
gem "rspec", "~> 3.5"
gem "webrick", "~> 1.8"
# "bigdecimal" is a gem on ruby-3.4+ and it's optional for ruby-pg.
# Specs should succeed without it, but 4 examples are then excluded.
# With bigdecimal commented out here, corresponding tests are omitted on ruby-3.4+ but are executed on ruby < 3.4.
Expand Down
16 changes: 16 additions & 0 deletions ext/gvl_wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,17 +281,33 @@ FOR_EACH_BLOCKING_FUNCTION( DEFINE_GVL_STUB_DECL );
* Definitions of callback functions and their parameters
*/

#define FOR_EACH_PARAM_OF_auth_data_hook_proxy(param) \
param(PGauthData, type) \
param(PGconn *, conn)

#define FOR_EACH_PARAM_OF_notice_processor_proxy(param) \
param(void *, arg)

#define FOR_EACH_PARAM_OF_notice_receiver_proxy(param) \
param(void *, arg)

/* function( name, void_or_nonvoid, returntype, lastparamtype, lastparamname ) */
#if PG_MAJORVERSION_NUM >= 18

#define FOR_EACH_CALLBACK_FUNCTION(function) \
function(auth_data_hook_proxy, GVL_TYPE_NONVOID, int, void *, data) \
function(notice_processor_proxy, GVL_TYPE_VOID, void, const char *, message) \
function(notice_receiver_proxy, GVL_TYPE_VOID, void, const PGresult *, result) \

#else

#define FOR_EACH_CALLBACK_FUNCTION(function) \
function(notice_processor_proxy, GVL_TYPE_VOID, void, const char *, message) \
function(notice_receiver_proxy, GVL_TYPE_VOID, void, const PGresult *, result) \

#endif

FOR_EACH_CALLBACK_FUNCTION( DEFINE_GVL_STUB_DECL );


#endif /* end __gvl_wrappers_h */
1 change: 1 addition & 0 deletions ext/pg.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@ Init_pg_ext(void)

/* Initialize the main extension classes */
init_pg_connection();
init_pg_auth_hooks();
init_pg_result();
init_pg_errors();
init_pg_type_map();
Expand Down
4 changes: 4 additions & 0 deletions ext/pg.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ extern VALUE pg_typemap_all_strings;
void Init_pg_ext _(( void ));

void init_pg_connection _(( void ));
void init_pg_auth_hooks _(( void ));
void init_pg_result _(( void ));
void init_pg_errors _(( void ));
void init_pg_type_map _(( void ));
Expand Down Expand Up @@ -375,6 +376,9 @@ rb_encoding * pg_get_pg_encname_as_rb_encoding _(( const char * ));
const char * pg_get_rb_encoding_as_pg_encoding _(( rb_encoding * ));
rb_encoding *pg_conn_enc_get _(( PGconn * ));

#if PG_MAJORVERSION_NUM >= 18
int auth_data_hook_proxy(PGauthData type, PGconn *conn, void *data);
#endif
void notice_receiver_proxy(void *arg, const PGresult *result);
void notice_processor_proxy(void *arg, const char *message);

Expand Down
Loading
Loading