Thread: ECPG - Timestamp to ascii Conversion PG version 7.4

ECPG - Timestamp to ascii Conversion PG version 7.4

From
Don Laurine
Date:
We are currently transitioning to Postgresql 7.4 from Informix. IN ECPG,
is there a Postgresql function which will convert the timestamp data
type to a string equivalent.  INFORMIX has the dtcvasc function but I
prefer not to use the -C compatibility option. I rather have a complete
port and get away from INFORMIX.


--
Don Laurine
NOAA, Northwest River Forecast Center
voice: (503) 326-7291 (ext. 323)

Re: ECPG - Timestamp to ascii Conversion PG version 7.4

From
"Dann Corbit"
Date:
template1=# \d bar
                 Table "public.bar"
  Column  |            Type             | Modifiers
----------+-----------------------------+-----------
 happened | timestamp without time zone |

template1=# select happened::varchar from bar;
        happened
-------------------------
 2005-05-05 11:19:38.066
 2005-05-05 11:19:40.082
 2005-05-05 11:19:41.097
(3 rows)

> -----Original Message-----
> From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-
> owner@postgresql.org] On Behalf Of Don Laurine
> Sent: Thursday, May 05, 2005 11:07 AM
> To: pgsql-general@postgresql.org
> Subject: [GENERAL] ECPG - Timestamp to ascii Conversion PG version 7.4
>
> We are currently transitioning to Postgresql 7.4 from Informix. IN
ECPG,
> is there a Postgresql function which will convert the timestamp data
> type to a string equivalent.  INFORMIX has the dtcvasc function but I
> prefer not to use the -C compatibility option. I rather have a
complete
> port and get away from INFORMIX.
>
>
> --
> Don Laurine
> NOAA, Northwest River Forecast Center
> voice: (503) 326-7291 (ext. 323)
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to
majordomo@postgresql.org)

Re: ECPG - Timestamp to ascii Conversion PG version 7.4

From
Michael Meskes
Date:
On Thu, May 05, 2005 at 11:07:10AM -0700, Don Laurine wrote:
> We are currently transitioning to Postgresql 7.4 from Informix. IN ECPG,
> is there a Postgresql function which will convert the timestamp data
> type to a string equivalent.  INFORMIX has the dtcvasc function but I
> prefer not to use the -C compatibility option. I rather have a complete
> port and get away from INFORMIX.

There is. You can use PGTYPEStimestamp_from_asc instead. You just have
to link against pgtypeslib.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!