From: | Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk> |
---|---|
To: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Richard Huxton <dev(at)archonet(dot)com> |
Cc: | pgsql-sql <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: where'd the spaces come from |
Date: | 2001-08-02 15:56:26 |
Message-ID: | 01080216562606.18757@gary.ringways.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Hi Bruce,
a fix for what?
If you're meaning the leading space, then the fix is in the followup post
that I made to my original quiestion. i.e.
psql -c "select to_char(12,'xFM000');"
to_char
---------
x012
(1 row)
The 'FM' removes the space.
Gary
On Thursday 02 August 2001 4:50 pm, Bruce Momjian wrote:
> Does anyone have a fix for this?
>
> > From: "Gary Stainburn" <gary(dot)stainburn(at)ringways(dot)co(dot)uk>
> >
> > > psql -c "select t.tregion || '/' || to_char(t.tnumber,'000') || '-' ||
> > > to_char(m.mnumber,'00') as unitno from teams t, members m
> > > where m.mteam = t.tid;"
> > > unitno
> > > -------------
> > > SW/ 041- 03
> > > SW/ 041- 05
> >
> > Looks like a buglet in to_char()s handling of numbers (unless I
> > misunderstand the way the formatting is supposed to work).
> >
> > select '[' || to_char(12,'x000') || ']';
> > ?column?
> > ----------
> > [x 012]
> >
> > If you're running the current version, might be worth posting a bug
> > report. You can work around it with something like:
> >
> > ... substr(to_char(t.tnumber,'000'),2,3) ...
> >
> > HTH
> >
> > - Richard Huxton
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 4: Don't 'kill -9' the postmaster
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
From | Date | Subject | |
---|---|---|---|
Next Message | Oleg Bartunov | 2001-08-02 16:16:29 | Re: Fuzzy matching? |
Previous Message | Bruce Momjian | 2001-08-02 15:50:32 | Re: where'd the spaces come from |