Skip site navigation (1) Skip section navigation (2)

Re: Simplify formatting.c

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Euler Taveira de Oliveira <euler(at)timbira(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Simplify formatting.c
Date: 2008-06-14 00:15:59
Message-ID: 200806140015.m5E0FxX02327@momjian.us (view raw or flat)
Thread:
Lists: pgsql-patches
Tom Lane wrote:
> Euler Taveira de Oliveira <euler(at)timbira(dot)com> writes:
> > Tom Lane wrote:
> >> Also, it seems a bit inconsistent to be relying on
> >> oracle_compat.c for upper/lower but not initcap.
> >> 
> > I saw this inconsistence while I'm doing the patch. What about moving 
> > that upper/lower/initcap and wcs* code to another file. pg_locale.c? 
> 
> That doesn't seem a particularly appropriate place for them.  pg_locale
> is about dealing with the locale state, not about doing actual
> operations based on the locale data.
> 
> I was just thinking of having oracle_compat expose an initcap routine.

You mean like the attached?

I moved str_initcap() over into oracle_compat.c and then had initcap()
convert to/from TEXT to call it.  The code is a little weird because
str_initcap() needs to convert to text to use texttowcs(), so in
multibyte encodings initcap converts the string to text, then to char,
then to text to call texttowcs().  I didn't see a cleaner way to do
this.

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

Attachment: /pgpatches/initcap
Description: text/x-diff (5.8 KB)

In response to

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2008-06-14 18:11:32
Subject: Re: Tentative patch for making DROP put dependency info in DETAIL
Previous:From: Zdenek KotalaDate: 2008-06-13 16:08:35
Subject: page macros cleanup

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group