Re: Fault with initcap

2021-10-12 Thread Lee Hachadoorian
On Tue, Oct 12, 2021 at 8:28 PM Adrian Klaver wrote: > > There is no function that just 'knows' that 'notemachine' is two words > and should become 'NoteMachine'. > Any chance that 'notemachine' is stored with a zero-width space (Unicode U+200B)? This is common for compound words where the progr

Re: Fault with initcap

2021-10-12 Thread Adrian Klaver
On 10/12/21 16:03, Shaozhong SHI wrote: Hi, Adrian Klaver, In Python, there is  a capwords.  Do we have an equivalent in Postgres? https://docs.python.org/3/library/string.html?highlight=capwords#string.capwords string.capwords(s, sep=None) Split the argument into words using str.

Re: Fault with initcap

2021-10-12 Thread Shaozhong SHI
On Tue, 12 Oct 2021 at 23:02, Adrian Klaver wrote: > On 10/12/21 13:50, Shaozhong SHI wrote: > > > > > > On Tue, 12 Oct 2021 at 20:34, Adrian Klaver > > > > Which follows the definition here: > > > > https://www.postgresql.org/docs/14/functions-string.html > >

Re: Avg/max size of these JSON docs in Postgres

2021-10-12 Thread Tomas Vondra
On 10/12/21 21:21, Michael Lewis wrote: On Tue, Oct 12, 2021 at 12:51 PM Simon Riggs mailto:simon.ri...@enterprisedb.com>> wrote: On Tue, 12 Oct 2021 at 18:53, Michael Lewis mailto:mle...@entrata.com>> wrote: > > On Tue, Oct 12, 2021 at 1:43 AM Simon Riggs mailto:simon.ri...@e

Re: Fault with initcap

2021-10-12 Thread Adrian Klaver
On 10/12/21 13:50, Shaozhong SHI wrote: On Tue, 12 Oct 2021 at 20:34, Adrian Klaver Which follows the definition here: https://www.postgresql.org/docs/14/functions-string.html initcap ( text ) → text Converts

Re: Fault with initcap

2021-10-12 Thread Karsten Hilbert
Am Tue, Oct 12, 2021 at 09:50:16PM +0100 schrieb Shaozhong SHI: > There must be a way to do the following. > > [...] Only the first letter of each word should be capitalised. Indeed, there is. It is called "human brain in cultural context". "AI" is close nowadays, but, hopefully, not quite there

Re: Fault with initcap

2021-10-12 Thread Shaozhong SHI
On Tue, 12 Oct 2021 at 20:34, Adrian Klaver wrote: > On 10/12/21 09:31, Shaozhong SHI wrote: > > I tried initcap and found a major problem with it. > > What Postgres version? > > In version 12 and 14 I get: > > > > > Initcap of notemachine is NoteMachine. > > select initcap('notemachine'); >

Aw: Re: Re: Fault with initcap

2021-10-12 Thread Karsten Hilbert
> Only the first letter of each word to be capitalised/uppercased. The next step is to not top-post. Then to keep the list involved if you wish further help. Then, if you are intent on using regular expressions, look at the PostgreSQL docs for regexp_replace. Karsten  

Re: Fault with initcap

2021-10-12 Thread Adrian Klaver
On 10/12/21 09:31, Shaozhong SHI wrote: I tried initcap and found a major problem with it. What Postgres version? In version 12 and 14 I get: Initcap of notemachine is NoteMachine. select initcap('notemachine'); initcap - Notemachine Initcap of Sainsbury's Bank is Sains

Re: Avg/max size of these JSON docs in Postgres

2021-10-12 Thread Michael Lewis
On Tue, Oct 12, 2021 at 12:51 PM Simon Riggs wrote: > On Tue, 12 Oct 2021 at 18:53, Michael Lewis wrote: > > > > On Tue, Oct 12, 2021 at 1:43 AM Simon Riggs < > simon.ri...@enterprisedb.com> wrote: > >> > >> On Tue, 12 Oct 2021 at 08:14, Ram Pratap Maurya > >> wrote: > >> > >> > Confirm what is

Re: Avg/max size of these JSON docs in Postgres

2021-10-12 Thread Simon Riggs
On Tue, 12 Oct 2021 at 18:53, Michael Lewis wrote: > > On Tue, Oct 12, 2021 at 1:43 AM Simon Riggs > wrote: >> >> On Tue, 12 Oct 2021 at 08:14, Ram Pratap Maurya >> wrote: >> >> > Confirm what is Avg/max size of these JSON docs in Postgres. >> >> JSON and JSONB datatypes can both be max 1GB in

Re: Avg/max size of these JSON docs in Postgres

2021-10-12 Thread Tom Lane
Michael Lewis writes: > Just to confirm- The compression associated with TOAST is only if the value > can fit in line, right? Columns don't get stored out-of-line in a toast > table as a compressed value as I read the documentation. I suppose that > would make reads a bit crazy. The default behav

Re: Avg/max size of these JSON docs in Postgres

2021-10-12 Thread Michael Lewis
On Tue, Oct 12, 2021 at 1:43 AM Simon Riggs wrote: > On Tue, 12 Oct 2021 at 08:14, Ram Pratap Maurya > wrote: > > > Confirm what is Avg/max size of these JSON docs in Postgres. > > JSON and JSONB datatypes can both be max 1GB in size. > That is per row. Just to confirm- The compression associa

Aw: Re: Fault with initcap

2021-10-12 Thread Karsten Hilbert
Hi David, >Expected are as follows: >Notemachine >Sainsbury's bank. Now, step two: generalize that exemplary definition. Karsten

Fault with initcap

2021-10-12 Thread Shaozhong SHI
I tried initcap and found a major problem with it. Initcap of notemachine is NoteMachine. Initcap of Sainsbury's Bank is Sainsbury'S bank. This is not expected. Anyway to get around this problem? Regards, David

Re: Avg/max size of these JSON docs in Postgres

2021-10-12 Thread Simon Riggs
On Tue, 12 Oct 2021 at 08:14, Ram Pratap Maurya wrote: > Confirm what is Avg/max size of these JSON docs in Postgres. JSON and JSONB datatypes can both be max 1GB in size. -- Simon Riggshttp://www.EnterpriseDB.com/

Avg/max size of these JSON docs in Postgres

2021-10-12 Thread Ram Pratap Maurya
Hi Team, Confirm what is Avg/max size of these JSON docs in Postgres. Regards, Ram Pratap.