List of shorthand casts

Started by FarjadFarid(ChkNet)over 11 years ago7 messagesgeneral
Jump to latest
#1FarjadFarid(ChkNet)
farjad.farid@checknetworks.com

Is the list of shorthand casts documented somewhere?
If so can you please direct me to it. A working URL would be great.

Many thanks.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: FarjadFarid(ChkNet) (#1)
Re: List of shorthand casts

FarjadFarid(ChkNet) wrote

Is the list of shorthand casts documented somewhere?
If so can you please direct me to it. A working URL would be great.

Do you mean implicit casts - those that do not require an explicit CAST(...)
or "::" in the query?

Can you give an example of one that you know exists?

The catalog is probably the best way to get a definitive list though I do
not know the exact query you would use. The catalog tables are fairly well
documented so you should start there.

David J.

--
View this message in context: http://postgresql.nabble.com/List-of-shorthand-casts-tp5829791p5829795.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3FarjadFarid(ChkNet)
farjad.farid@checknetworks.com
In reply to: David G. Johnston (#2)
Re: List of shorthand casts

Hi David,

I mean the ones with "::" like ::text or ::uuid etc

Some of Postgresql data types have two words or more like "double precision"
or " timestamp without time zone". It is not clear how these are
implemented if at all.

Many thank.

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of David G Johnston
Sent: 09 December 2014 20:23
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] List of shorthand casts

FarjadFarid(ChkNet) wrote

Is the list of shorthand casts documented somewhere?
If so can you please direct me to it. A working URL would be great.

Do you mean implicit casts - those that do not require an explicit CAST(...)
or "::" in the query?

Can you give an example of one that you know exists?

The catalog is probably the best way to get a definitive list though I do
not know the exact query you would use. The catalog tables are fairly well
documented so you should start there.

David J.

--
View this message in context:
http://postgresql.nabble.com/List-of-shorthand-casts-tp5829791p5829795.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make
changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: FarjadFarid(ChkNet) (#3)
Re: List of shorthand casts

"FarjadFarid\(ChkNet\)" <farjad.farid@checknetworks.com> writes:

I mean the ones with "::" like ::text or ::uuid etc

Some of Postgresql data types have two words or more like "double precision"
or " timestamp without time zone". It is not clear how these are
implemented if at all.

Any type name works fine after "::".

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Adrian Klaver
adrian.klaver@aklaver.com
In reply to: FarjadFarid(ChkNet) (#3)
Re: List of shorthand casts

On 12/09/2014 01:37 PM, FarjadFarid(ChkNet) wrote:

Hi David,

I mean the ones with "::" like ::text or ::uuid etc

Some of Postgresql data types have two words or more like "double precision"
or " timestamp without time zone". It is not clear how these are
implemented if at all.

Try the query below to get most of the casts available:

select castsource::regtype, casttarget::regtype from pg_cast order by
castsource;

For more info and caveats see:

http://www.postgresql.org/docs/9.3/interactive/catalog-pg-cast.html

Many thank.

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of David G Johnston
Sent: 09 December 2014 20:23
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] List of shorthand casts

FarjadFarid(ChkNet) wrote

Is the list of shorthand casts documented somewhere?
If so can you please direct me to it. A working URL would be great.

Do you mean implicit casts - those that do not require an explicit CAST(...)
or "::" in the query?

Can you give an example of one that you know exists?

The catalog is probably the best way to get a definitive list though I do
not know the exact query you would use. The catalog tables are fairly well
documented so you should start there.

David J.

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#6FarjadFarid(ChkNet)
farjad.farid@checknetworks.com
In reply to: Tom Lane (#4)
Re: List of shorthand casts

Got it thanks.

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Tom Lane
Sent: 09 December 2014 21:40
To: FarjadFarid(ChkNet)
Cc: 'David G Johnston'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] List of shorthand casts

"FarjadFarid\(ChkNet\)" <farjad.farid@checknetworks.com> writes:

I mean the ones with "::" like ::text or ::uuid etc

Some of Postgresql data types have two words or more like "double

precision"

or " timestamp without time zone". It is not clear how these are
implemented if at all.

Any type name works fine after "::".

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make
changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#7FarjadFarid(ChkNet)
farjad.farid@checknetworks.com
In reply to: Adrian Klaver (#5)
Re: List of shorthand casts

Thanks.

-----Original Message-----
From: Adrian Klaver [mailto:adrian.klaver@aklaver.com]
Sent: 09 December 2014 21:46
To: FarjadFarid(ChkNet); 'David G Johnston'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] List of shorthand casts

On 12/09/2014 01:37 PM, FarjadFarid(ChkNet) wrote:

Hi David,

I mean the ones with "::" like ::text or ::uuid etc

Some of Postgresql data types have two words or more like "double

precision"

or " timestamp without time zone". It is not clear how these are
implemented if at all.

Try the query below to get most of the casts available:

select castsource::regtype, casttarget::regtype from pg_cast order by
castsource;

For more info and caveats see:

http://www.postgresql.org/docs/9.3/interactive/catalog-pg-cast.html

Many thank.

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of David G
Johnston
Sent: 09 December 2014 20:23
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] List of shorthand casts

FarjadFarid(ChkNet) wrote

Is the list of shorthand casts documented somewhere?
If so can you please direct me to it. A working URL would be great.

Do you mean implicit casts - those that do not require an explicit
CAST(...) or "::" in the query?

Can you give an example of one that you know exists?

The catalog is probably the best way to get a definitive list though I
do not know the exact query you would use. The catalog tables are
fairly well documented so you should start there.

David J.

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general