This page describes the BigQuery data types and mappings that
you must create on your AlloyDB for PostgreSQL cluster when you're accessing
BigQuery data from AlloyDB. For more information,
see [Access BigQuery data from AlloyDB](https://docs.cloud.google.com/alloydb/docs/access-bigquery-data-from-alloydb).

Using unsupported mappings can lead to query execution errors or unintended
results. For example, mapping a BigQuery string column to a
AlloyDB integer column causes an error. However, if you map a
string in AlloyDB to a BigQuery integer, the query
doesn't error out; instead, the integer is typecasted to a string.

| **BigQuery table [data type](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/data-types.md.txt)** | **Recommended PostgreSQL foreign table [data types](https://www.postgresql.org/docs/current/datatype.html)** |
|---|---|
| `BOOLEAN` | `BOOLEAN` |
| `INTEGER (INT64)` | `BIGINT` |
| `FLOAT (FLOAT64)` | `DOUBLE PRECISION` |
| `STRING` | `VARCHAR` |
| `NUMERIC` | `NUMERIC(38, 9)` |
| `NUMERIC(P[, S])` | `NUMERIC(P, S)` |
| `BIGNUMERIC` | `NUMERIC(77, 38)` |
| `BIGNUMERIC(P[, S])` | `NUMERIC(P, S)` |
| `DATE` | `DATE` |
| `TIMESTAMP` | `TIMESTAMPTZ` |
| `TIME` | `TIME` |
| `JSON` | `JSONB` |
| `BYTES` | `BYTEA` |
| `GEOGRAPHY` | `GEOGRAPHY(POINT), ...` <br /> For more information, see [PostGIS_Geography](https://postgis.net/docs/using_postgis_dbmanagement.html#PostGIS_Geography.). |
| `DATETIME` | `TIMESTAMP` |
| `ARRAY<FLOAT64>` | `VECTOR(N)` <br /> N is the dimension of the vector. Requires setting the flag `bigquery_fdw.enable_vector_downcasting` in the session. Since `VECTOR` type in AlloyDB for PostgreSQL uses `float4` type, there is a possibility of precision loss in this conversion. <br /> For more information, see [pgvector extension.](https://github.com/pgvector/pgvector) |

### What's next

- [Access BigQuery data from AlloyDB](https://docs.cloud.google.com/alloydb/docs/access-bigquery-data-from-alloydb).
- [Sync BigQuery and Apache Iceberg data to AlloyDB](https://docs.cloud.google.com/alloydb/docs/sync-bigquery-data-to-alloydb.md.txt).
- [Access Apache Iceberg data from AlloyDB](https://docs.cloud.google.com/alloydb/docs/access-iceberg-data-from-alloydb.md.txt).
- Learn about [use cases for accessing BigQuery data from AlloyDB](https://docs.cloud.google.com/alloydb/docs/bigquery-view-alloydb-overview).