Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1maPrW-0001bg-97 for pgsql-general@arkaria.postgresql.org; Tue, 12 Oct 2021 22:03:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1maPrT-0000Wr-UD for pgsql-general@arkaria.postgresql.org; Tue, 12 Oct 2021 22:03:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1maPrS-0000WA-7i for pgsql-general@lists.postgresql.org; Tue, 12 Oct 2021 22:03:03 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1maPrP-0001JB-75 for pgsql-general@lists.postgresql.org; Tue, 12 Oct 2021 22:03:01 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 95A873200E86; Tue, 12 Oct 2021 18:02:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 12 Oct 2021 18:02:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=d ND/POBGpY6mFBPm9xMq/Uiq3eOu7HfqgqBpdU3/AC8=; b=RoMcK0FXjomS0H4Ep RWWlqjXotWVDjI6H+2bnanYJz+0mCR/U1fEgmVq1n/N8oUfu2ER/dRZEGyBKHhAK p83E9M+KlKESQNmrdkj6FgM961QRdZ7EfJNax/hnSWfEa3ELUn8Jy376+BZGs/8M wKP1hDhmCU1jcDlLohoGnI9IEZEAgZlBvj/lZYk1PihyPZRnYtNw4/typkuiKbck Alxqg0p7pW0c466EDUalItXCn71Yofo4RE5MfSZdLb4KD5Dq0vXTrMJpiGjpprEb rnlOTq1D8dtYjEfj4z6xtmQWFQ2k6De3iTfXKmOjdh9xBLKUYk5xBTj6VaJq5Qcs Tcq5A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=dND/POBGpY6mFBPm9xMq/Uiq3eOu7HfqgqBpdU3/A C8=; b=lfROyWlgxRLapvf4VksGPajq7rReZgDhUPaO34tVT1BImgodhcjMM1F9p 649GYFnPsslzxwIqqcDwoJweUTI0x93A+b3bOD23avacsfXef1daomyoHWXQXDi2 Zj/tGWkbAYIKJ/1m6ease/bTvXOyWhNK1/BG4lZXv7k7q1YJ3TnzcHFP695xV5+X iQRXbcJrRy5Pgzjf97A3Q/CmJEFOOQxXFtn5uBPROnF862KMgH4ope+yM59+gtq2 +RhhfSz0ZVQdU5P8PGor2saofRjtRFoUT2F8D1rCQIqOe0Ev1tBHT44OsZnIMV3p uiSoGdVeUQSFwqUWu9K8wr2QeD+Kw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddtledgtdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpefhjeevueeutdelgfffvddvtdelffefvddujeefvddt teekhffhieekgfeuffeujeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgpd hgrhgrmhhmrghrlhihrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Oct 2021 18:02:56 -0400 (EDT) Message-ID: <157d10c3-a683-3373-3550-06113149cc51@aklaver.com> Date: Tue, 12 Oct 2021 15:02:55 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: Fault with initcap Content-Language: en-US To: Shaozhong SHI Cc: pgsql-general References: <10fbeda1-606a-553b-3598-eca814f40bb7@aklaver.com> From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 the first letter of each word to upper case and the rest to > lower case. Words are sequences of alphanumeric characters separated by > non-alphanumeric characters. > > Hi, Adrian Klaver, > > > It looks like that you replicated the error. There is no error, initcap is doing what it is documented to. notemachine is not two words anymore then 'online', 'bluebell', 'network' are. > > There must be a way to do the following. Maybe, but as Karsten says it would involve an AI. One that understands the mutt language that is English. > > a column contains a list of words.  Only the first letter of each word > should be capitalised.  INITCAP can not do that.  How to create a > function just to capitalised each word (substring) in a list of > words/strings.  This will be very useful and create great impact. From here: https://www.grammarly.com/blog/14-of-the-longest-words-in-english/ uncopyrightable where would you split that into words?: Some 'words' I see: un unc copy copyright right table able > > Regards, > > David -- Adrian Klaver adrian.klaver@aklaver.com