Re: Undetected Deadlock

2022-01-27 Thread Michael Harris
> but I would expect drop concurrently to resolve your issue with the two > processes conflicting I guess you mean ALTER TABLE DETACH PARTITION ... CONCURRENTLY? DROP TABLE does not seem to have a concurrent option. Still that does seem like a good option to try, thanks for drawing it to my atten

Re: Counting the number of repeated phrases in a column

2022-01-27 Thread Merlin Moncure
On Thu, Jan 27, 2022 at 11:56 AM wrote: > Le 27/01/2022 à 18:35, Merlin Moncure a écrit : > > select distinct array_to_string(v[a:b], ' ') phrase, count(*) as occurrences > > from > > ( > >select array_agg(t) v > >from > >( > > select trim(replace(unnest(v), E'\n', '')) t > >

Re: could not open relation with OID

2022-01-27 Thread Ben Chobot
Michael Paquier wrote on 1/26/22 9:14 PM: On Wed, Jan 26, 2022 at 05:30:01PM -0800, Ben Chobot wrote: Other things we've considered:     - we run pg_repack, which certainly seems like it could make an error like this, but we see this error in places and times that pg_repack isn't currently runn

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

Re: Counting the number of repeated phrases in a column

2022-01-27 Thread Merlin Moncure
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(string_to_array((select sentence from s), phr

Re: Counting the number of repeated phrases in a column

2022-01-27 Thread Rob Sargent
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(string_to_array((select sentence from s), phrase), 1) - 1 as occurrances from ( select array_to_string(x, '

Re: Counting the number of repeated phrases in a column

2022-01-27 Thread Merlin Moncure
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(string_to_array((select sentence from s), phrase), 1) - > 1 as occurrances > from > ( > select array_to_string(x, ' ') as phrase > from > (