Skip to content

Handle C bindings exit #2114

@latot

Description

@latot

Hi! I has been using pgrx, the experience in general has been nice!

In order use it, and extend functionalities I has been using C bindings with other postgres extension, I has been easily to connect PGRX + C Bindings! I have already tested this.

There is one issue I have found using them, is when a C bindings calls exit function, this one makes PG crash, and PGRX crash (for example using pgrx tests).

At first I thought to handle this situation inside each extension, but any binding from any extension can call exit, so maybe is better handle this situation from PGRX, if it can handle the exit would be a lot easier to write extensions that needs bindings.

I think bindings are nice here, helps to extend actual extensions and slowly move parts from C to Rust.
This is not only because I'm making bindings from a postgres extension, any binding from any C app that uses exit would have this behaviour.

I think I can try write a basic case for tests, I think we can talk about this if think is needed I can upload one here.

Thx!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions