Re: Gen_fmgrtab.sh fails with LANG=et_EE

Lists: pgsql-hackerspgsql-patches
From: "Marko Kreen" <markokr(at)gmail(dot)com>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Gen_fmgrtab.sh fails with LANG=et_EE
Date: 2006-09-05 08:57:54
Message-ID: e51f66da0609050157h5a5e67ccq975d023a88370d6a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

I recently changed locale in my machine and PostgreSQL build broke.
The reason is that Gen_fmgrtab.sh uses [^A-Z] expression to sed
and the GNU people in their infinite wisdom made that locale-dependant.

As the script uses the complicated pipeline only for fmgroids.h -> FMGROIDS_H
conversion, it seems simpler to just make it explicitly set, instead to
try to work around GNU sed.

I grepped around source and did not find other instances of this.
The A-Z experssion was only in perl scripts or in configure and
configure should be fine as it explicitly resets locale.

--
marko

Attachment Content-Type Size
genfmgrtab.diff text/x-patch 1.6 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org, "Marko Kreen" <markokr(at)gmail(dot)com>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Gen_fmgrtab.sh fails with LANG=et_EE
Date: 2006-09-05 14:38:41
Message-ID: 24536.1157467121@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

"Marko Kreen" <markokr(at)gmail(dot)com> writes:
> I grepped around source and did not find other instances of this.
> The A-Z experssion was only in perl scripts or in configure and
> configure should be fine as it explicitly resets locale.

Why not do the same in Gen_fmgrtab.sh? A quick LANG=C seems less
invasive than this.

regards, tom lane


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-patches(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Marko Kreen" <markokr(at)gmail(dot)com>
Subject: Re: Gen_fmgrtab.sh fails with LANG=et_EE
Date: 2006-09-05 19:06:53
Message-ID: 200609052106.54198.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> "Marko Kreen" <markokr(at)gmail(dot)com> writes:
> > I grepped around source and did not find other instances of this.
> > The A-Z experssion was only in perl scripts or in configure and
> > configure should be fine as it explicitly resets locale.
>
> Why not do the same in Gen_fmgrtab.sh? A quick LANG=C seems less
> invasive than this.

Well, the line of code is

cpp_define=`echo $OIDSFILE | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | sed -e 's/[^A-Z]/_/g'`

so it ought to be pretty obvious what the correct solution for the
problem "character ranges are locale-dependent" is.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org, "Marko Kreen" <markokr(at)gmail(dot)com>
Subject: Re: [HACKERS] Gen_fmgrtab.sh fails with LANG=et_EE
Date: 2006-09-05 19:19:40
Message-ID: 18691.1157483980@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Well, the line of code is
> cpp_define=`echo $OIDSFILE | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | sed -e 's/[^A-Z]/_/g'`
> so it ought to be pretty obvious what the correct solution for the
> problem "character ranges are locale-dependent" is.

Doh. Patched that way.

Curiously, I couldn't replicate the failure on Fedora 5 --- Marko's
platform must have different locale behavior for et_EE.

regards, tom lane


From: "Marko Kreen" <markokr(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Gen_fmgrtab.sh fails with LANG=et_EE
Date: 2006-09-05 20:37:29
Message-ID: e51f66da0609051337x6abce533j3426deed5e4c7c5f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On 9/5/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > Well, the line of code is
> > cpp_define=`echo $OIDSFILE | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | sed -e 's/[^A-Z]/_/g'`
> > so it ought to be pretty obvious what the correct solution for the
> > problem "character ranges are locale-dependent" is.
>
> Doh. Patched that way.
>
> Curiously, I couldn't replicate the failure on Fedora 5 --- Marko's
> platform must have different locale behavior for et_EE.

Did you add it to locale-gen config and ran it?

Btw, I removed all the pipeline in my patch, because I felt
such messy pipeline for such a tiny thing is ugly. Especially
as the filename wont change that much. Thus I though it would
be cleaner to just put the symbol together with filename definition.

--
marko