Skip to content

How to force not to get primary key on insert action #1350

@soyking

Description

@soyking

I use peewee as PostgreSQL orm. As I saw on InsertQuery.execute, when is_insert_returning is set, peewee will use RETURNING to get primary key. Otherwise it will call last_insert_id which is implemented by SELECT CURRVAL in PostgreSQL.

In my case, I use partition function on Postgres. So I will RETURN NULL when inserting a row, which means RETURNING won't work. And SELECT CURRVAL will fail as well.

So I open this issue to make sure that whether there is a way to force not to get primary key after insert action. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions