Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/current/v23.1/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ When inserting a `STRING` value or a `STRING`-related-type value:
- If the value is cast with a length limit (e.g., `CAST('hello world' AS STRING(5))`), CockroachDB truncates to the limit. This applies to `STRING(n)` and all related types.
- If the value exceeds the column's length limit, CockroachDB returns an error. This applies to `STRING(n)` and all related types.
- For `STRING(n)` and `VARCHAR(n)`/`CHARACTER VARYING(n)` types, if the value is under the column's length limit, CockroachDB does **not** add space padding to the end of the value.
- For `CHAR(n)`/`CHARACTER(n)` types, if the value is under the column's length limit, CockroachDB adds space padding from the end of the value to the length limit.
- For `CHAR(n)`/`CHARACTER(n)` types, values shorter than the column length are displayed to SQL clients with trailing spaces added to the length limit. SQL expressions treat trailing spaces as insignificant, so functions such as `length()` evaluate the unpadded value.

{{site.data.alerts.callout_info}}
Changefeeds evaluate `CHAR(n)` values through SQL expressions, so trailing padding is not emitted unless you add it explicitly in the changefeed query, for example with `rpad()`. Use `STRING(n)`/`VARCHAR(n)` if trailing spaces must be preserved as stored data.
{{site.data.alerts.end}}

Type | Length
--------------------------------------------------|------------------------------
Expand Down
6 changes: 5 additions & 1 deletion src/current/v23.2/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ When inserting a `STRING` value or a `STRING`-related-type value:
- If the value is cast with a length limit (e.g., `CAST('hello world' AS STRING(5))`), CockroachDB truncates to the limit. This applies to `STRING(n)` and all related types.
- If the value exceeds the column's length limit, CockroachDB returns an error. This applies to `STRING(n)` and all related types.
- For `STRING(n)` and `VARCHAR(n)`/`CHARACTER VARYING(n)` types, if the value is under the column's length limit, CockroachDB does **not** add space padding to the end of the value.
- For `CHAR(n)`/`CHARACTER(n)` types, if the value is under the column's length limit, CockroachDB adds space padding from the end of the value to the length limit.
- For `CHAR(n)`/`CHARACTER(n)` types, values shorter than the column length are displayed to SQL clients with trailing spaces added to the length limit. SQL expressions treat trailing spaces as insignificant, so functions such as `length()` evaluate the unpadded value.

{{site.data.alerts.callout_info}}
Changefeeds evaluate `CHAR(n)` values through SQL expressions, so trailing padding is not emitted unless you add it explicitly in the changefeed query, for example with `rpad()`. Use `STRING(n)`/`VARCHAR(n)` if trailing spaces must be preserved as stored data.
{{site.data.alerts.end}}

Type | Length
--------------------------------------------------|------------------------------
Expand Down
6 changes: 5 additions & 1 deletion src/current/v24.1/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ When inserting a `STRING` value or a `STRING`-related-type value:
- If the value is cast with a length limit (e.g., `CAST('hello world' AS STRING(5))`), CockroachDB truncates to the limit. This applies to `STRING(n)` and all related types.
- If the value exceeds the column's length limit, CockroachDB returns an error. This applies to `STRING(n)` and all related types.
- For `STRING(n)` and `VARCHAR(n)`/`CHARACTER VARYING(n)` types, if the value is under the column's length limit, CockroachDB does **not** add space padding to the end of the value.
- For `CHAR(n)`/`CHARACTER(n)` types, if the value is under the column's length limit, CockroachDB adds space padding from the end of the value to the length limit.
- For `CHAR(n)`/`CHARACTER(n)` types, values shorter than the column length are displayed to SQL clients with trailing spaces added to the length limit. SQL expressions treat trailing spaces as insignificant, so functions such as `length()` evaluate the unpadded value.

{{site.data.alerts.callout_info}}
Changefeeds evaluate `CHAR(n)` values through SQL expressions, so trailing padding is not emitted unless you add it explicitly in the changefeed query, for example with `rpad()`. Use `STRING(n)`/`VARCHAR(n)` if trailing spaces must be preserved as stored data.
{{site.data.alerts.end}}

Type | Length
--------------------------------------------------|------------------------------
Expand Down
6 changes: 5 additions & 1 deletion src/current/v24.2/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ When inserting a `STRING` value or a `STRING`-related-type value:
- If the value is cast with a length limit (e.g., `CAST('hello world' AS STRING(5))`), CockroachDB truncates to the limit. This applies to `STRING(n)` and all related types.
- If the value exceeds the column's length limit, CockroachDB returns an error. This applies to `STRING(n)` and all related types.
- For `STRING(n)` and `VARCHAR(n)`/`CHARACTER VARYING(n)` types, if the value is under the column's length limit, CockroachDB does **not** add space padding to the end of the value.
- For `CHAR(n)`/`CHARACTER(n)` types, if the value is under the column's length limit, CockroachDB adds space padding from the end of the value to the length limit.
- For `CHAR(n)`/`CHARACTER(n)` types, values shorter than the column length are displayed to SQL clients with trailing spaces added to the length limit. SQL expressions treat trailing spaces as insignificant, so functions such as `length()` evaluate the unpadded value.

{{site.data.alerts.callout_info}}
Changefeeds evaluate `CHAR(n)` values through SQL expressions, so trailing padding is not emitted unless you add it explicitly in the changefeed query, for example with `rpad()`. Use `STRING(n)`/`VARCHAR(n)` if trailing spaces must be preserved as stored data.
{{site.data.alerts.end}}

Type | Length
--------------------------------------------------|------------------------------
Expand Down
6 changes: 5 additions & 1 deletion src/current/v24.3/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ When inserting a `STRING` value or a `STRING`-related-type value:
- If the value is cast with a length limit (e.g., `CAST('hello world' AS STRING(5))`), CockroachDB truncates to the limit. This applies to `STRING(n)` and all related types.
- If the value exceeds the column's length limit, CockroachDB returns an error. This applies to `STRING(n)` and all related types.
- For `STRING(n)` and `VARCHAR(n)`/`CHARACTER VARYING(n)` types, if the value is under the column's length limit, CockroachDB does **not** add space padding to the end of the value.
- For `CHAR(n)`/`CHARACTER(n)` types, if the value is under the column's length limit, CockroachDB adds space padding from the end of the value to the length limit.
- For `CHAR(n)`/`CHARACTER(n)` types, values shorter than the column length are displayed to SQL clients with trailing spaces added to the length limit. SQL expressions treat trailing spaces as insignificant, so functions such as `length()` evaluate the unpadded value.

{{site.data.alerts.callout_info}}
Changefeeds evaluate `CHAR(n)` values through SQL expressions, so trailing padding is not emitted unless you add it explicitly in the changefeed query, for example with `rpad()`. Use `STRING(n)`/`VARCHAR(n)` if trailing spaces must be preserved as stored data.
{{site.data.alerts.end}}

Type | Length
--------------------------------------------------|------------------------------
Expand Down
6 changes: 5 additions & 1 deletion src/current/v25.1/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ When inserting a `STRING` value or a `STRING`-related-type value:
- If the value is cast with a length limit (e.g., `CAST('hello world' AS STRING(5))`), CockroachDB truncates to the limit. This applies to `STRING(n)` and all related types.
- If the value exceeds the column's length limit, CockroachDB returns an error. This applies to `STRING(n)` and all related types.
- For `STRING(n)` and `VARCHAR(n)`/`CHARACTER VARYING(n)` types, if the value is under the column's length limit, CockroachDB does **not** add space padding to the end of the value.
- For `CHAR(n)`/`CHARACTER(n)` types, if the value is under the column's length limit, CockroachDB adds space padding from the end of the value to the length limit.
- For `CHAR(n)`/`CHARACTER(n)` types, values shorter than the column length are displayed to SQL clients with trailing spaces added to the length limit. SQL expressions treat trailing spaces as insignificant, so functions such as `length()` evaluate the unpadded value.

{{site.data.alerts.callout_info}}
Changefeeds evaluate `CHAR(n)` values through SQL expressions, so trailing padding is not emitted unless you add it explicitly in the changefeed query, for example with `rpad()`. Use `STRING(n)`/`VARCHAR(n)` if trailing spaces must be preserved as stored data.
{{site.data.alerts.end}}

Type | Length
--------------------------------------------------|------------------------------
Expand Down
6 changes: 5 additions & 1 deletion src/current/v25.2/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ When inserting a `STRING` value or a `STRING`-related-type value:
- If the value is cast with a length limit (e.g., `CAST('hello world' AS STRING(5))`), CockroachDB truncates to the limit. This applies to `STRING(n)` and all related types.
- If the value exceeds the column's length limit, CockroachDB returns an error. This applies to `STRING(n)` and all related types.
- For `STRING(n)` and `VARCHAR(n)`/`CHARACTER VARYING(n)` types, if the value is under the column's length limit, CockroachDB does **not** add space padding to the end of the value.
- For `CHAR(n)`/`CHARACTER(n)` types, if the value is under the column's length limit, CockroachDB adds space padding from the end of the value to the length limit.
- For `CHAR(n)`/`CHARACTER(n)` types, values shorter than the column length are displayed to SQL clients with trailing spaces added to the length limit. SQL expressions treat trailing spaces as insignificant, so functions such as `length()` evaluate the unpadded value.

{{site.data.alerts.callout_info}}
Changefeeds evaluate `CHAR(n)` values through SQL expressions, so trailing padding is not emitted unless you add it explicitly in the changefeed query, for example with `rpad()`. Use `STRING(n)`/`VARCHAR(n)` if trailing spaces must be preserved as stored data.
{{site.data.alerts.end}}

Type | Length
--------------------------------------------------|------------------------------
Expand Down
6 changes: 5 additions & 1 deletion src/current/v25.3/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ When inserting a `STRING` value or a `STRING`-related-type value:
- If the value is cast with a length limit (e.g., `CAST('hello world' AS STRING(5))`), CockroachDB truncates to the limit. This applies to `STRING(n)` and all related types.
- If the value exceeds the column's length limit, CockroachDB returns an error. This applies to `STRING(n)` and all related types.
- For `STRING(n)` and `VARCHAR(n)`/`CHARACTER VARYING(n)` types, if the value is under the column's length limit, CockroachDB does **not** add space padding to the end of the value.
- For `CHAR(n)`/`CHARACTER(n)` types, if the value is under the column's length limit, CockroachDB adds space padding from the end of the value to the length limit.
- For `CHAR(n)`/`CHARACTER(n)` types, values shorter than the column length are displayed to SQL clients with trailing spaces added to the length limit. SQL expressions treat trailing spaces as insignificant, so functions such as `length()` evaluate the unpadded value.

{{site.data.alerts.callout_info}}
Changefeeds evaluate `CHAR(n)` values through SQL expressions, so trailing padding is not emitted unless you add it explicitly in the changefeed query, for example with `rpad()`. Use `STRING(n)`/`VARCHAR(n)` if trailing spaces must be preserved as stored data.
{{site.data.alerts.end}}

Type | Length
--------------------------------------------------|------------------------------
Expand Down
6 changes: 5 additions & 1 deletion src/current/v25.4/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ When inserting a `STRING` value or a `STRING`-related-type value:
- If the value is cast with a length limit (e.g., `CAST('hello world' AS STRING(5))`), CockroachDB truncates to the limit. This applies to `STRING(n)` and all related types.
- If the value exceeds the column's length limit, CockroachDB returns an error. This applies to `STRING(n)` and all related types.
- For `STRING(n)` and `VARCHAR(n)`/`CHARACTER VARYING(n)` types, if the value is under the column's length limit, CockroachDB does **not** add space padding to the end of the value.
- For `CHAR(n)`/`CHARACTER(n)` types, if the value is under the column's length limit, CockroachDB adds space padding from the end of the value to the length limit.
- For `CHAR(n)`/`CHARACTER(n)` types, values shorter than the column length are displayed to SQL clients with trailing spaces added to the length limit. SQL expressions treat trailing spaces as insignificant, so functions such as `length()` evaluate the unpadded value.

{{site.data.alerts.callout_info}}
Changefeeds evaluate `CHAR(n)` values through SQL expressions, so trailing padding is not emitted unless you add it explicitly in the changefeed query, for example with `rpad()`. Use `STRING(n)`/`VARCHAR(n)` if trailing spaces must be preserved as stored data.
{{site.data.alerts.end}}

Type | Length
--------------------------------------------------|------------------------------
Expand Down
6 changes: 5 additions & 1 deletion src/current/v26.1/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ When inserting a `STRING` value or a `STRING`-related-type value:
- If the value is cast with a length limit (e.g., `CAST('hello world' AS STRING(5))`), CockroachDB truncates to the limit. This applies to `STRING(n)` and all related types.
- If the value exceeds the column's length limit, CockroachDB returns an error. This applies to `STRING(n)` and all related types.
- For `STRING(n)` and `VARCHAR(n)`/`CHARACTER VARYING(n)` types, if the value is under the column's length limit, CockroachDB does **not** add space padding to the end of the value.
- For `CHAR(n)`/`CHARACTER(n)` types, if the value is under the column's length limit, CockroachDB adds space padding from the end of the value to the length limit.
- For `CHAR(n)`/`CHARACTER(n)` types, values shorter than the column length are displayed to SQL clients with trailing spaces added to the length limit. SQL expressions treat trailing spaces as insignificant, so functions such as `length()` evaluate the unpadded value.

{{site.data.alerts.callout_info}}
Changefeeds evaluate `CHAR(n)` values through SQL expressions, so trailing padding is not emitted unless you add it explicitly in the changefeed query, for example with `rpad()`. Use `STRING(n)`/`VARCHAR(n)` if trailing spaces must be preserved as stored data.
{{site.data.alerts.end}}

Type | Length
--------------------------------------------------|------------------------------
Expand Down
6 changes: 5 additions & 1 deletion src/current/v26.2/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ When inserting a `STRING` value or a `STRING`-related-type value:
- If the value is cast with a length limit (e.g., `CAST('hello world' AS STRING(5))`), CockroachDB truncates to the limit. This applies to `STRING(n)` and all related types.
- If the value exceeds the column's length limit, CockroachDB returns an error. This applies to `STRING(n)` and all related types.
- For `STRING(n)` and `VARCHAR(n)`/`CHARACTER VARYING(n)` types, if the value is under the column's length limit, CockroachDB does **not** add space padding to the end of the value.
- For `CHAR(n)`/`CHARACTER(n)` types, if the value is under the column's length limit, CockroachDB adds space padding from the end of the value to the length limit.
- For `CHAR(n)`/`CHARACTER(n)` types, values shorter than the column length are displayed to SQL clients with trailing spaces added to the length limit. SQL expressions treat trailing spaces as insignificant, so functions such as `length()` evaluate the unpadded value.

{{site.data.alerts.callout_info}}
Changefeeds evaluate `CHAR(n)` values through SQL expressions, so trailing padding is not emitted unless you add it explicitly in the changefeed query, for example with `rpad()`. Use `STRING(n)`/`VARCHAR(n)` if trailing spaces must be preserved as stored data.
{{site.data.alerts.end}}

Type | Length
--------------------------------------------------|------------------------------
Expand Down
Loading