Chapter 10. Type Conversion

|   Chapter 10. Type Conversion   |              |                         |                  |                               |
|:-------------------------------:|--------------|-------------------------|------------------|-------------------------------|
|[Prev](functions-statistics.html)|[Up](sql.html)|Part II. The SQL Language|[Home](index.html)| [Next](typeconv-overview.html)|

---

## Chapter 10. Type Conversion

**Table of Contents**

[10.1. Overview](typeconv-overview.html)[10.2. Operators](typeconv-oper.html)[10.3. Functions](typeconv-func.html)[10.4. Value Storage](typeconv-query.html)[10.5. `UNION`, `CASE`, and Related Constructs](typeconv-union-case.html)[10.6. `SELECT` Output Columns](typeconv-select.html)

[]()

SQL statements can, intentionally or not, require
the mixing of different data types in the same expression.PostgreSQL has extensive facilities for
evaluating mixed-type expressions.

In many cases a user does not need
to understand the details of the type conversion mechanism.
However, implicit conversions done by PostgreSQLcan affect the results of a query. When necessary, these results
can be tailored by using *explicit* type conversion.

This chapter introduces the PostgreSQLtype conversion mechanisms and conventions.
Refer to the relevant sections in [Chapter 8](datatype.html) and [Chapter 9](functions.html)for more information on specific data types and allowed functions and
operators.

---

|  [Prev](functions-statistics.html)   |  [Up](sql.html)  | [Next](typeconv-overview.html)|
|:-------------------------------------|:----------------:|------------------------------:|
|9.30. Statistics Information Functions|[Home](index.html)|         10.1. Overview        |

 // \<![CDATA[ \<-- For SVG support if ('WebSocket' in window) { (function() { function refreshCSS() { var sheets = [].slice.call(document.getElementsByTagName("link")); var head = document.getElementsByTagName("head")[0]; for (var i = 0; i \< sheets.length; ++i) { var elem = sheets[i]; head.removeChild(elem); var rel = elem.rel; if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") { var url = elem.href.replace(/(&|\\?)\_cacheOverride=\\d+/, ''); elem.href = url + (url.indexOf('?') \>= 0 ? '&' : '?') + '\_cacheOverride=' + (new Date().valueOf()); } head.appendChild(elem); } } var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; var address = protocol + window.location.host + window.location.pathname + '/ws'; var socket = new WebSocket(address); socket.onmessage = function(msg) { if (msg.data == 'reload') window.location.reload(); else if (msg.data == 'refreshcss') refreshCSS(); }; console.log('Live reload enabled.'); })(); } // ]]\>