1

I was wondering if anyone knows which types are binary compatible or incompatible in Postgres.

I'm particularly interested in cases where a CREATE CAST from one type to another could cause Postgres to crash.

If someone happens to have a pointer to a matrix showing type (in)compatibility, that would be ideal.

Thanks in advance.    

1 Answer 1

3

Data types that are binary-compatible generally already have WITHOUT FUNCTION casts defined for them.

A cast via a function is always safe, and not going to cause a problem.

If you want to add new WITHOUT FUNCTION casts, the only real reference is the source code, examining compatibility on a type-by-type basis.

Sign up to request clarification or add additional context in comments.

1 Comment

I noticed that the pg_cast table records possible casts from one data type to data type: postgresql.org/docs/8.3/static/catalog-pg-cast.html Some implicit conversion types appear here: docs.aws.amazon.com/redshift/latest/dg/r_Type_conversion.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.