X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 6C52F9DC8A1 for ; Tue, 14 Mar 2006 04:18:28 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 71294-06 for ; Tue, 14 Mar 2006 04:18:29 -0400 (AST) X-Greylist: delayed 00:21:53.602863 by SQLgrey- Received: from mercury.wardbrook.com (host-84-9-98-118.bulldogdsl.com [84.9.98.118]) by postgresql.org (Postfix) with ESMTP id 2590B9DC81E for ; Tue, 14 Mar 2006 04:18:26 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mercury.wardbrook.com (Postfix) with ESMTP id E7F04532EB; Tue, 14 Mar 2006 07:54:10 +0000 (GMT) Received: by mercury.wardbrook.com (Postfix, from userid 505) id BEE08532F8; Tue, 14 Mar 2006 07:54:09 +0000 (GMT) Received: from [192.168.0.64] (unknown [192.168.0.1]) by mercury.wardbrook.com (Postfix) with ESMTP id 8CEFD532EB; Tue, 14 Mar 2006 07:54:08 +0000 (GMT) Message-ID: <4416772F.1050603@wardbrook.com> Date: Tue, 14 Mar 2006 07:56:31 +0000 From: John Sidney-Woollett User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: emilu@encs.concordia.ca Cc: pgsql-general@postgresql.org Subject: Re: Update value to "the first character is capital and References: <4415F2C0.3040707@encs.concordia.ca> In-Reply-To: <4415F2C0.3040707@encs.concordia.ca> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS 0.3.12 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.08 required=5 tests=[AWL=0.080] X-Spam-Score: 0.08 X-Spam-Level: X-Archive-Number: 200603/536 X-Sequence-Number: 92401 Have you tried the initcap function? select initcap('abcd efgh'); initcap ----------- Abcd Efgh John Emi Lu wrote: > Hello all, > > Does anyone have available plpgsql codes to update all capital letters > in a column to "the first character is capital and the rest is small" ? > > For example, in tableA(id, description) > 001, 'ZHANG ZHE XIN' => > 'Zhang Zhe Xin' > 002, 'LIU, WEI-HUAI' > => 'Liu, Wei-Huai' > 003, 'GU & WEI. NAN (CE SHI) & TOMMORROW' => 'Gu & Wei. Nan (Ce > Shi) & Tommorrow' > > Thanks a lot! > Ying > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings