Skip to content

Errors when entity has a JSONB column - postgres - naming convention not respected #1706

Open
@ocoster-sermo

Description

@ocoster-sermo

I have an entity with a JSONB column - when trying to bulk update (either in an object graph using IncludeGraph = true or with multiple bulk inserts using a transaction), I am getting errors.

The naming convention I use is snake case, meaning a property Promotions should be translated to promotions and IsTrue to is_true. This works for all other columns in my entity, except for this JSONB type (configured in mapping to use ToJson).

I am getting errors like the following:

C#

PostgresException: 42703: column "Promotions" of relation "employeeTempaa5d0fea" does not exist

DB logs:

    ERROR:  column "Promotions" of relation "employeeTempaa5d0fea" does not exist
    STATEMENT:  COPY "public"."employeeTempaa5d0fea" ("id", "building_id", "created_at", "eligible_for_bonus", "location_id", "manager_id", "modified_at", "original_building_id", "provider_id", "provider_settings_id", "status", "Promotions") FROM STDIN (FORMAT BINARY);
    ERROR:  current transaction is aborted, commands ignored until end of transaction block
    STATEMENT:  DROP TABLE IF EXISTS "public"."employeeTempaa5d0fea"
    LOG:  could not receive data from client: An existing connection was forcibly closed by the remote host.  

Here's a sample repo showing the issue (see Tester.cs - and a script to create the DB tables in the root folder).

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