admin管理员组文章数量:1336643
I have a integer[] slots in my PostgreSQL table and would like to use unnest to fill it in bulk.
cmd.CommandText = "INSERT INTO inventory (slots) " +
"SELECT t.slots " +
"FROM UNNEST(@slots) AS t(slots) " +
"RETURNING inventory_id";
cmd.Parameters.AddWithValue("@slots", new int[10][]);0
When I try this approach (just to test 10 entries with empty array of ints), I'm getting the following error:
Error: The CRL array type System.Int32[][] isn't supported by Npgsql or your PostgreSQL. If you wish to map it to an PostgreSQL composite type array you need to register it before usage.
Is there a simple solution to it?
I tried to add "NpgsqlDbType.Array | NpgsqlDbType.Integer
", but to no avail.
本文标签: cUnnest Npgsql bulk query for integer array elementStack Overflow
版权声明:本文标题:c# - Unnest Npgsql bulk query for integer array element - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742417560a2471011.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论