to_char replacement
This is a multi-part message in MIME format.
------=_NextPart_000_0011_01C50245.2A205C50
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello, since to_char() function will no longer be available from =
PostgreSQL 8.1 ... I might need to change that from my scripts.
For example I had something like that, which you can see returns the day =
in the format I need:
SELECT TO_CHAR(some_date, 'DD-MM-YYYY') FROM some_table;
Is there anyway to do that without TO_CHAR?
------=_NextPart_000_0011_01C50245.2A205C50
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#e3e1db>
<DIV><FONT face=3DVerdana color=3D#800000 size=3D2>Hello, since =
to_char() function
will no longer be available from PostgreSQL 8.1 ... I might need to =
change
that from my scripts.</FONT></DIV>
<DIV><FONT face=3DVerdana color=3D#800000 size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana color=3D#800000 size=3D2>For example I had =
something like
that, which you can see returns the day in the format I =
need:</FONT></DIV>
<DIV><FONT face=3DVerdana color=3D#800000 size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana color=3D#800000 size=3D2>SELECT =
TO_CHAR(some_date,
'DD-MM-YYYY') FROM some_table;</FONT></DIV>
<DIV><FONT face=3DVerdana color=3D#800000 size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana color=3D#800000 size=3D2>Is there anyway to do =
that without
TO_CHAR?</FONT></DIV></BODY></HTML>
------=_NextPart_000_0011_01C50245.2A205C50--
Re: to_char replacement
to_char() will still be around for dates, just not for intervals. You
have nothing to worry about.
Chris
Raul Secan wrote:
>
> Hello, since to_char() function will no longer be available from
> PostgreSQL 8.1 ... I might need to change that from my scripts.
>
> For example I had something like that, which you can see returns the day
> in the format I need:
>
> SELECT TO_CHAR(some_date, 'DD-MM-YYYY') FROM some_table;
>
> Is there anyway to do that without TO_CHAR?
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
Re: to_char replacement
On Mon, Jan 24, 2005 at 06:47:33PM +0200, Raul Secan wrote:
> Hello, since to_char() function will no longer be available from
> PostgreSQL 8.1 ... I might need to change that from my scripts.
Eh? Where did you get the idea that to_char() was going away? The
documentation says that to_char(interval, text) is deprecated and
will be removed, but it says nothing about removing the function
altogether.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
Re: to_char replacement
At 12:44 PM 1/24/05, Michael Fuhr wrote:
>On Mon, Jan 24, 2005 at 06:47:33PM +0200, Raul Secan wrote:
>
> > Hello, since to_char() function will no longer be available from
> > PostgreSQL 8.1 ... I might need to change that from my scripts.
>
>Eh? Where did you get the idea that to_char() was going away? The
>documentation says that to_char(interval, text) is deprecated and
>will be removed, but it says nothing about removing the function
>altogether.
Raul is not the only one who misread that sentence. I thought the same
thing when I read it last week. Reading too quickly, I guess. After
spending several minutes searching for a replacement function, I went back
a reread it, understanding it the second time. Perhaps if
to_char(interval, text) were marked with (*) in table and then (*) note at
bottom, it would be clearer that this sentence does not apply to all arguments.
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
Re: to_char replacement
Frank Bax wrote:
> At 12:44 PM 1/24/05, Michael Fuhr wrote:
>
> >On Mon, Jan 24, 2005 at 06:47:33PM +0200, Raul Secan wrote:
> >
> > > Hello, since to_char() function will no longer be available from
> > > PostgreSQL 8.1 ... I might need to change that from my scripts.
> >
> >Eh? Where did you get the idea that to_char() was going away? The
> >documentation says that to_char(interval, text) is deprecated and
> >will be removed, but it says nothing about removing the function
> >altogether.
>
>
> Raul is not the only one who misread that sentence. I thought the same
> thing when I read it last week. Reading too quickly, I guess. After
> spending several minutes searching for a replacement function, I went back
> a reread it, understanding it the second time. Perhaps if
> to_char(interval, text) were marked with (*) in table and then (*) note at
> bottom, it would be clearer that this sentence does not apply to all arguments.
Agreed. I think we were a little too concise in that statement. Here is
the updated wording:
The 8.1 release will remove the <function>to_char()</> function
for intervals.
--
Bruce Momjian | http://candle.pha.pa.us
pgman [at] candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend