Postgres Database Data Transformation _ database other

Source: Internet
Author: User
Tags time interval types of tables postgres database
Actually "::" is called the cast function. What exactly are the data conversions between the fields?
This problem can be answered only by studying the cast function. The information of the cast function is managed in the System Pg_cast table.
Through the query we can get the current stage can be converted to the types of tables below:
Source Type conversion Target type
Int8 Int2
Int8 int4
int8 FLOAT4
Int8 float8
int8 Numeric
Int2 int8
Int2 Int4
Int2 FLOAT4
Int2 Float8
Int2 Numeric
Int4 int8
Int4 Int2
Int4 FLOAT4
Int4 Float8
INT4 Numeric
FLOAT4 int8
FLOAT4 Int2
FLOAT4 Int4
FLOAT4 FLOAT8
FLOAT4 Numeric
Float8 int8
Float8 Int2
Float8 Int4
Float8 FLOAT4
FLOAT8 Numeric
Numeric int8
Numeric Int2
Numeric int4
Numeric FLOAT4
Numeric FLOAT8
INT4 BOOL
BOOL Int4
Int8 OID
Int2 OID
OID int8
Int8 Regproc
Int2 Regproc
Regproc int8
Int8 regprocedure
Int2 regprocedure
Regprocedure int8
Int8 Regoper
Int2 Regoper
Regoper int8
Int8 Regoperator
Int2 Regoperator
Regoperator int8
Int8 Regclass
Int2 Regclass
Regclass int8
Int8 Regtype
Int2 Regtype
Regtype int8
Int8 Regconfig
Int2 Regconfig
Regconfig int8
Int8 regdictionary
Int2 regdictionary
Regdictionary int8
Text Regclass
varchar Regclass
Bpchar text
Bpchar varchar
Char text
Char Bpchar
Char varchar
Name text
Name Bpchar
Name varchar
Text Char
Bpchar Char
varchar Char
Text name
Bpchar Name
varchar name
Char Int4
Int4 Char
Abstime Date
Abstime time
Abstime Timestamp
Abstime TIMESTAMPTZ
Reltime interval
Date Timestamp
Date Timestamptz
Time interval
Time Timetz
Timestamp Abstime
Timestamp date
Timestamp time
Timestamp TIMESTAMPTZ
TIMESTAMPTZ Abstime
TIMESTAMPTZ Date
TIMESTAMPTZ time
TIMESTAMPTZ Timestamp
TIMESTAMPTZ Timetz
Interval Reltime
Interval time
Timetz time
LSEG Point
Path Point
Path polygon
Box Point
Box lseg
Box polygon
Box Circle
Polygon Point
Polygon Path
Polygon Box
Polygon Circle
Circle Point
Circle Box
Circle Polygon
inet CIDR
Int8 bit
Int4 bit
Bit int8
Bit int4
CIDR text
inet text
BOOL Text
Text XML
CIDR varchar
inet varchar
BOOL varchar
varchar XML
CIDR Bpchar
inet Bpchar
BOOL Bpchar
Bpchar XML
Bpchar Bpchar
varchar varchar
Time Time
Timestamp timestamp
TIMESTAMPTZ TIMESTAMPTZ
Interval interval
Timetz Timetz
Bit bit
Varbit Varbit
Numeric numeric

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.