Re: Counting the number of repeated phrases in a column

2022-01-26 Thread Ivan E. Panchenko
On 26.01.2022 11:11, Shaozhong SHI wrote: On Tue, 25 Jan 2022 at 21:33, Ivan Panchenko mailto:i.panche...@postgrespro.ru>> wrote: On 26.01.2022 00:21, benj@laposte.net wrote: > Le 25/01/2022 à 18:10, Shaozhong SHI a écrit : >> There is a

Re: Incremental backup

2021-10-28 Thread Ivan E. Panchenko
On 28.10.2021 15:58, Ron wrote: On 10/28/21 7:23 AM, Edu Gargiulo wrote: Hi all, Is there any way to make incremental backups in postgres-12? Using pg_dump?  No. Using pgBackRest?  Yes. https://github.com/postgrespro/pg_probackup --

Re: How to do phrase search?

2020-07-11 Thread Ivan E. Panchenko
Hello, On 10.07.2020 21:22, Anto Aravinth wrote: Hello, I have the following table: so2, which has following column details: ​ |id, title, posts, body (tsvector). | And I created the index on the following: |"so2_pkey" PRIMARY KEY, btree (id)| |"body" gin (body)| ​ And I wanted to

Re: PostgreSQL 13: native JavaScript Procedural Language support ?

2020-03-26 Thread Ivan E. Panchenko
On 26.03.2020 03:50, Bruce Momjian wrote: On Wed, Mar 25, 2020 at 05:46:27PM +0200, Marius Andreiana wrote: Thanks Tom, that makes sense. Appreciate your time to explain the context. I'll followup with Heroku. Also, I have heard PL/V8 is very hard to build for packagers (because of changes

Re: Extract elements from JSON array and return them as concatenated string

2018-03-14 Thread Ivan E. Panchenko
14.03.2018 20:02, Alexander Farber пишет: Thank you, Ivan! I am trying to apply your suggestion to my table - On Wed, Mar 14, 2018 at 5:34 PM, Ivan E. Panchenko <i.panche...@postgrespro.ru <mailto:i.panche...@postgrespro.ru>> wrote: Hi Alex, SELECT  string_agg(x->>

Re: Extract elements from JSON array and return them as concatenated string

2018-03-14 Thread Ivan E. Panchenko
Hi Alex, SELECT  string_agg(x->>'letter','') FROM json_array_elements( '[{"col": 7, "row": 12, "value": 3, "letter": "A"}, {"col": 8, "row": 12, "value": 10, "letter": "B"}, {"col": 9, "row": 12, "value": 1, "letter": "C"}, {"col": 10, "row": 12, "value": 2, "letter": "D"}]'::json ) x;

Re: How to Optimize pg_trgm Performance

2018-01-30 Thread Ivan E. Panchenko
Hi Igal, 29.01.2018 02:42, Igal @ Lucee.org пишет: I want to use pg_trgm for auto-suggest functionality.  I created a Materialized View with the information that I need, with the relevant columns being (keywords text, rank int). keywords is the column from which I build the tri-grams, and

Re: Slow alter sequence with PG10.1

2018-01-22 Thread Ivan E. Panchenko
I also confirm this problem: Running Michael's script on 10.1 takes 314 seconds instead of 2.3 seconds on 9.6.5. Moreover adding some timing shows that on 10.1 the iteration execution time grows linearly with each iteration. (!!) If we remove ALTER SEQUENCE, the difference is only 2.5

Re: Mailing list archiver

2018-01-03 Thread Ivan E. Panchenko
Hi, Btw, there is also another web interface to the mail list archives at Postgres Pro web site, https://postgrespro.com/list Regards, Ivan  03.01.2018 05:45, Jordan Deitch пишет: This project serves to organize and archive the postgres mailing list: http://pg.rsa.pub/ Let me know what

Re: Selecting a JSON object of arrays from a PostgreSQL table

2018-01-01 Thread Ivan E. Panchenko
Hi Alex! Why not: select json_object_agg(gid, y) from     ( select gid, jsonb_agg(row_to_json(chat)) y from chat group by gid     ) x; Regards, Ivan 01.01.2018 16:41, Alexander Farber пишет: Hello and happy new year! I have prepared a simple SQL Fiddle

Re: jsonb and where clause?

2017-11-28 Thread Ivan E. Panchenko
28.11.2017 13:25, Bjorn T Johansen пишет: On Tue, 28 Nov 2017 11:28:55 +0300 "Ivan E. Panchenko" <i.panche...@postgrespro.ru> wrote: Hi Bjorn, 28.11.2017 11:18, Bjorn T Johansen пишет: Hi. Just starting to look at how to use jsonb columns and I have a question. I have foun

Re: jsonb and where clause?

2017-11-28 Thread Ivan E. Panchenko
Hi Bjorn, 28.11.2017 11:18, Bjorn T Johansen пишет: Hi. Just starting to look at how to use jsonb columns and I have a question. I have found out that I can use the following to search for a value inside the jsonb column: select * from orders where info ->> 'customer' = 'John Doe'(where

Re: update field in jsonb

2017-11-22 Thread Ivan E. Panchenko
23.11.2017 04:45, support-tiger пишет: is there a way to update a single field in jsonb without replacing the entire json document - couldn't find an example for example create table test (id primary key, data jsonb); insert into test ({"name":"bill", "age":29});  ?? update test   set