Re: How to implent the CONVERT ( data_type [ ( length ) ] , expression ) function in PostgreSQL

From: Emanuel Calvo <emanuel(dot)calvo(at)2ndquadrant(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to implent the CONVERT ( data_type [ ( length ) ] , expression ) function in PostgreSQL
Date: 2014-11-02 14:13:24
Message-ID: 54563C04.3090508@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


El 02/11/14 a las 07:15, rohtodeveloper escibió:
> Dear
>
> I'm doing a job about converting an expression of one data type to
> another.
> In SQLServer, there'are two functions to do this job.
>

From which data_type to which one? In psql, the option \dC, will give
you the list of supported casts.

Did you try the cast operand?

postgres=# select '1235'::int , 823::text, (now()::date)::text;
int4 | text | now
------+------+------------
1235 | 823 | 2014-11-02
(1 row)

--
--
Emanuel Calvo http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-11-02 14:35:16 Re: How to implent the CONVERT ( data_type [ ( length ) ] , expression ) function in PostgreSQL
Previous Message rohtodeveloper 2014-11-02 10:15:56 How to implent the CONVERT ( data_type [ ( length ) ] , expression ) function in PostgreSQL