> ## Documentation Index
> Fetch the complete documentation index at: https://docs.risingwave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Casting

> Certain data types can be cast to and from other types implicitly or explicitly.

* **Implicitly cast to**: Values can be automatically converted to the target type.
* **Assigned to**: Values can be automatically converted when inserted to a column of the target type.
* **Explicitly cast to**: Values can be converted to the target type using explicit [Type casts](/sql/query-syntax/value-exp#type-casts).

| From type                    | Implicitly cast to                                                                            | Assigned to                                                                     | Explicitly cast to                                                                                                                                                                                                                 |
| :--------------------------- | :-------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **boolean**                  |                                                                                               | varchar                                                                         | integer                                                                                                                                                                                                                            |
| **smallint**                 | integer  <br />bigint  <br />numeric  <br />real  <br />double  <br />rw\_int256              | varchar                                                                         |                                                                                                                                                                                                                                    |
| **integer**                  | bigint  <br />numeric  <br />real  <br />double  <br />rw\_int256                             | smallint                                                                        | boolean                                                                                                                                                                                                                            |
| **bigint**                   | numeric  <br />real  <br />double  <br />rw\_int256                                           | smallint  <br />integer  <br />varchar                                          |                                                                                                                                                                                                                                    |
| **numeric**                  | real  <br />double                                                                            | smallint  <br />integer  <br />bigint  <br />varchar                            |                                                                                                                                                                                                                                    |
| **real**                     | double                                                                                        | smallint  <br />integer  <br />bigint  <br />numeric  <br />varchar             |                                                                                                                                                                                                                                    |
| **double**                   |                                                                                               | smallint  <br />integer  <br />bigint  <br />numeric  <br />real  <br />varchar |                                                                                                                                                                                                                                    |
| **varchar**                  |                                                                                               |                                                                                 | boolean  <br />smallint  <br />integer  <br />bigint  <br />numeric  <br />real  <br />double  <br />date  <br />timestamp  <br />timestamp with time zone  <br />time  <br />interval  <br />bytea  <br />jsonb  <br />rw\_int256 |
| **date**                     | timestamp  <br />timestamp with time zone                                                     | varchar                                                                         |                                                                                                                                                                                                                                    |
| **timestamp**                | timestamp with time zone                                                                      | varchar  <br />date  <br />time                                                 |                                                                                                                                                                                                                                    |
| **timestamp with time zone** |                                                                                               | varchar  <br />date  <br />timestamp  <br />time                                |                                                                                                                                                                                                                                    |
| **time**                     | interval                                                                                      | varchar                                                                         |                                                                                                                                                                                                                                    |
| **interval**                 |                                                                                               | varchar  <br />time                                                             |                                                                                                                                                                                                                                    |
| **bytea**                    |                                                                                               | varchar                                                                         |                                                                                                                                                                                                                                    |
| **jsonb**                    | boolean  <br />smallint  <br />integer  <br />bigint  <br />numeric  <br />real  <br />double | varchar                                                                         |                                                                                                                                                                                                                                    |
| **rw\_int256**               |                                                                                               | varchar                                                                         |                                                                                                                                                                                                                                    |

<Note>
  Structs can be casted to structs explicitly or implicitly if the nested expressions and types can be casted.
</Note>
