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 1EC989DC8AC; Mon, 13 Mar 2006 18:36:06 -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 77766-06; Mon, 13 Mar 2006 18:36:07 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from mx2.surnet.cl (mx2.surnet.cl [216.155.73.181]) by postgresql.org (Postfix) with ESMTP id E75029DCDAA; Mon, 13 Mar 2006 18:36:02 -0400 (AST) Received: from unknown (HELO cluster.surnet.cl) ([216.155.73.165]) by mx2.surnet.cl with ESMTP; 13 Mar 2006 18:36:06 -0400 X-IronPort-AV: i="4.02,188,1139194800"; d="scan'208"; a="36258199:sNHT18441976" Received: from alvh.no-ip.org (201.221.200.21) by cluster.surnet.cl (7.0.043) (authenticated as alvherre@surnet.cl) id 43A978FD00A38DEC; Mon, 13 Mar 2006 18:36:05 -0400 Received: by alvh.no-ip.org (Postfix, from userid 1000) id D73C0C3A2BE; Mon, 13 Mar 2006 18:36:04 -0400 (CLT) Date: Mon, 13 Mar 2006 18:36:04 -0400 From: Alvaro Herrera To: Emi Lu Cc: pgsql-general@postgresql.org, pgsql-sql@postgresql.org Subject: Re: [SQL] Update value to "the first character is capital and the rest is small" Message-ID: <20060313223604.GF18322@surnet.cl> Mail-Followup-To: Emi Lu , pgsql-general@postgresql.org, pgsql-sql@postgresql.org References: <4415F2C0.3040707@encs.concordia.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4415F2C0.3040707@encs.concordia.ca> User-Agent: Mutt/1.5.11+cvs20060126 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.554 required=5 tests=[AWL=-0.365, DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_POST=1.44] X-Spam-Score: 1.554 X-Spam-Level: * X-Archive-Number: 200603/519 X-Sequence-Number: 92384 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" ? I don't know about plpgsql codes, but there is a function initcap() that you can use for that. alvherre=# select initcap('GU & WEI. NAN (CE SHI) & TOMMORROW'); initcap ------------------------------------ Gu & Wei. Nan (Ce Shi) & Tommorrow (1 row) -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support