Re: delete query using CTE

2022-03-13 Thread benj . dev
Le 13/03/2022 à 15:44, Roger Bos a écrit : Hello, trying to use CTE to remove duplicates from a table.  The DELETE version does not work, but the SELECT version does, so I am not understanding what the problem is.  Any suggestions on how to fix it? Here is my query: WITH cte AS ( SELECT *, RO

Planner choose to use big index instead of smaller one

2022-11-23 Thread benj . dev
Hi, I have a table tpoint near that 820Mo with 700K lignes I have created 2 index on this table : CREATE INDEX idx_small_index ON public.tpoint USING btree (match_id); -- Size : 4560 kB CREATE INDEX idx_big_index   ON public.tpoint USING btree (version, match_id, playnum, code_action, num_balle

plpgsql function problem whith creating temp table - not correctly using search_path ?

2022-01-11 Thread benj . dev
Hi, I would like to submit a problem (bug ?) that I encountered while handling temporary tables in plpgsql functions. First, if I create a TABLE and a TEMP TABLE with the same name, and I request without specified the schema, the temporary table is used. -- SHOW search_path; -- => "$user", pub

Re: plpgsql function problem whith creating temp table - not correctly using search_path ?

2022-01-11 Thread benj . dev
‌Hi, Thank you for pointing this part of the documentation. It's actually works with EXECUTE 'INSERT INTO my_table VALUES((random() * 100)::INT);'; INSTEAD OF INSERT INTO my_table VALUES((random() * 100)::INT); And it's possible to suppose that the test_search_path_v2 worked before because of the

Re: Counting the number of repeated phrases in a column

2022-01-25 Thread benj . dev
Le 25/01/2022 à 18:10, Shaozhong SHI a écrit : There is a short of a function in the standard Postgres to do the following: It is easy to count the number of occurrence of words, but it is rather difficult to count the number of occurrence of phrases. For instance: A cell of value:  'Hello W

Re: Counting the number of repeated phrases in a column

2022-01-26 Thread benj . dev
>On Tue, 25 Jan 2022 at 21:33, Ivan Panchenko > >wrote: > > >> >> On 26.01.2022 00:21, benj(dot)dev(at)laposte(dot)net wrote: >> > Le 25/01/2022 à 18:10, Shaozhong SHI a écrit : >> >> There is a short of a function in the standard Postgres to do the >> >> following: >> >> >> >> It is easy to count

Re: Counting the number of repeated phrases in a column

2022-01-27 Thread benj . dev
Le 27/01/2022 à 18:35, Merlin Moncure a écrit : On Thu, Jan 27, 2022 at 11:09 AM Rob Sargent wrote: On 1/27/22 10:03, Merlin Moncure wrote: On Wed, Jan 26, 2022 at 5:23 PM Merlin Moncure wrote: with s as (select 'Hello World Hello World' as sentence) select phrase, array_upper(strin