# lc_ctype

> lc_ctype — Shows the character classification and case conversion locale. Observed in PG9.0–15; its last measured boot default is C in PG15, with internal context. It was removed in PG16.
---

> [!NOTE]
> **Fact — official short description:** “Shows the character classification and case conversion locale.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `string` | Upstream pg_settings type |
| Context | `internal` | Internal/preset and not user-settable |
| Unit | — | Raw unit |
| Range | — | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Preset Options | Upstream classification |
| Latest boot value | `C` | C |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG9.0 (research boundary) |
| Present in | PG9.0–15 |
| Removed in | PG16 |
| Introduction commit | Not asserted: predates the PG9.0 research boundary |
| Commit date | — |
| Discussion | — |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG9.0–15 | `C` | — | C |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

Reported the current database’s character-classification and case-conversion locale through PG15. It was internal/read-only and PostgreSQL 16 removed it from pg_settings.

The locale is fixed when a database is created and can differ by database. It affects locale-aware character classes and case conversion, but is not a session switch and cannot be changed with ALTER SYSTEM.

On PG16 and later, migrate SHOW/current_setting consumers to pg_database locale-provider metadata and inspect pg_collation for object-level behavior. Application tests should cover case conversion and pattern/character-class assumptions.

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| OLTP | Not tunable. Migrate readers to pg_database and test case-folding, upper/lower behavior, and expression indexes before a locale/provider upgrade. |
| OLAP | Record locale metadata with ETL outputs whose classification or normalization depends on it. Changing the locale requires deliberate migration, not a runtime setting. |
| Small nodes | Keep locale choice explicit at database creation and in rebuild automation. Do not assume the host default is stable across images or operating-system upgrades. |
{.full-width}

## Pigsty {#pigsty}

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG15; this does not assert current Pigsty support for that historical or beta release.

| Template | Effective value | Versus upstream boot | Source expression |
| --- | --- | --- | --- |
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG9.0–15 unmodified; OLAP: PG9.0–15 unmodified; CRIT: PG9.0–15 unmodified; TINY: PG9.0–15 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- Trying to configure a value that was always internal/read-only.
- Assuming character classification is identical across databases or locale providers.
- Changing locale libraries without testing expression indexes and case-conversion results.
- Migrating only monitoring text while leaving applications dependent on SHOW lc_ctype.

## Related parameters {#related-parameters}

[`lc_collate`](/parameters/lc-collate/) · [`server_encoding`](/parameters/server-encoding/) · [`client_encoding`](/parameters/client-encoding/) · [`icu_validation_level`](/parameters/icu-validation-level/) · [`default_text_search_config`](/parameters/default-text-search-config/) · [`server_version_num`](/parameters/server-version-num/)

## References {#references}

- [PostgreSQL 15 — lc_ctype](https://www.postgresql.org/docs/15/runtime-config-preset.html#GUC-LC-CTYPE)
- [Machine-readable GUC export](/data/guc.jsonl)
