postgresql-12

How to deal with a text[] array field type in Npgsql?

不打扰是莪最后的温柔 提交于 2020-02-29 08:04:41
问题 I have a Postgres 12 database with a single table: CREATE TABLE public.messages ( sender text COLLATE pg_catalog."default", "timestamp" timestamp with time zone, message_id bigint, text text COLLATE pg_catalog."default", priority bigint, parameters text[] COLLATE pg_catalog."default" ) Now, when I want to use this table in met .NET Winforms (not .NET Core) application by right-clicking the project, add new item, ADO.NET Entitity Data Model, EF Code First from Database, configuring my

How to deal with a text[] array field type in Npgsql?

百般思念 提交于 2020-02-29 08:04:15
问题 I have a Postgres 12 database with a single table: CREATE TABLE public.messages ( sender text COLLATE pg_catalog."default", "timestamp" timestamp with time zone, message_id bigint, text text COLLATE pg_catalog."default", priority bigint, parameters text[] COLLATE pg_catalog."default" ) Now, when I want to use this table in met .NET Winforms (not .NET Core) application by right-clicking the project, add new item, ADO.NET Entitity Data Model, EF Code First from Database, configuring my

why the query is executed 76 times slower when I put it into function?

不打扰是莪最后的温柔 提交于 2019-12-11 06:06:20
问题 When I put next query into function it goes 76times slower. The only difference at plan is: bitmap-index scan VS index scan Plan1: http://tatiyants.com/pev/#/plans/plan_1562919134481 Plan2: http://tatiyants.com/pev/#/plans/plan_1562918860704 plan1 EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON) SELECT sum( t.group_suma ) OVER( PARTITION BY (t.o).id ) AS total_suma, * FROM ( SELECT sum( ocd.item_cost ) AS group_cost, sum( ocd.item_suma ) AS group_suma, max( (ocd.ic).consumed ) AS

Postgresql query for objects in nested JSONB field

不羁的心 提交于 2019-12-04 09:07:08
问题 I am using PostgreSQL 9.6, and I have a table named "ItemDbModel" with two columns looks like: No integer, Content jsonb Say I put many records like: "No": 2, {"obj":"x","Item": {"Name": "BigDog", "Model": "NamedHusky", "Spec":"red dog"}} "No": 4, {"obj":"x","Item": {"Name": "MidDog", "Model": "NamedPeppy", "Spec":"no hair"}} "No": 5, {"obj":"x","Item": {"Name": "BigCat", "Model": "TomCat", "Spec":"blue color"}} How can I query the table for: Records where "Content.Item.Name" contains "Dog"