You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a use case where enum array column would be perfect. Select works without problems but I'm unable to perform insert or update.
Here is a sample schema:
DROP TABLE IF EXISTS "item" CASCADE;
DROP TYPE IF EXISTS "item_type_enum" CASCADE;
CREATE TYPE "item_type_enum" AS ENUM (
'type1',
'type2',
'type3'
);
CREATE TABLE IF NOT EXISTS "item"
(
"id" INT NOT NULL,
"type" "item_type_enum",
"types" "item_type_enum"[],
CONSTRAINT pk_item PRIMARY KEY (id)
);
Info: BeforeExecute
-- PostgreSQL.9.5 PostgreSQL (asynchronously)
DECLARE @Id Integer -- Int32
SET @Id = 3
DECLARE @Types -- Object
SET @Types = {'type1','type2'}
INSERT INTO "public".item
(
id,
types
)
VALUES
(
:Id,
:Types
)
, DataConnection
Error: Error
Exception: System.NotSupportedException
Message : The CLR type System.Object isn't natively supported by Npgsql or your PostgreSQL. To use it with a PostgreSQL composite you need to specify DataTypeName or to map it, please refer to the documentation.
I have a use case where enum array column would be perfect. Select works without problems but I'm unable to perform insert or update.
Here is a sample schema:
And here is sample code:
Insert/update/select with single enum type columns (not enum array) works fine.
Trying to insert value into enum array columns:
throws following error:
If I add following mapping:
then I get following error:
Tried using SetValueToSqlConverter but it's never triggered:
Any suggestions to make this work?
Environment details
Linq To DB
version: 5.4.1Database (with version): PostgreSQL 16
Operating system: Windows 10
.NET Version: 8.0
The text was updated successfully, but these errors were encountered: