Skip to content

PostgreSQL "INSERT RETURNING" feature and pear db query type expectation #44

@DanCld

Description

@DanCld

PostgreSQL supports returning data from data manipulation queries (docs: https://www.postgresql.org/docs/current/dml-returning.html). The most interesting part is about retrieving the inserted row id, offering a race-free mechanism that is both lightweight and easy to use.

Pear DB has this concept of queries being either on the "read" or the "write" side, with distinct code paths handling responses and also a regex filter thrown in for good measure on the "read" side.

I'm not seeing any non-hacky ways myself to implement a way to handle this feature, but I suppose a discussion on the matter wouldn't hurt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions