# 0L000 — invalid_grantor

> PostgreSQL SQLSTATE 0L000: invalid_grantor, source-backed diagnosis and recovery guidance.
---

# 0L000

## At a glance {#at-a-glance}

SQLSTATE `0L000` is **invalid_grantor** in Class `0L`. The fixed `aclparse` path uses it as a backward-compatible warning when old ACL item text omits the `/grantor` suffix: it defaults the grantor to `BOOTSTRAP_SUPERUSERID`. This is ACL text parsing, not a bootstrap or ACL-initialization phase and not the ordinary “permission denied” or invalid GRANT-operation path.

<!-- BEGIN SQLSTATE FACTS: generated by scripts/generate.py; do not edit -->

| Field | Value |
| --- | --- |
| SQLSTATE | `0L000` |
| Condition | `invalid_grantor` |
| Status | `active` |
| Known present by | `7.4` |
| Locked snapshots | `9.0.23, 9.1.24, 9.2.24, 9.3.25, 9.4.26, 9.5.25, 9.6.24, 10.23, 11.22, 12.22, 13.23, 14.24, 15.19, 16.15, 17.11, 18.6, 19beta3` |
| Macros | `ERRCODE_INVALID_GRANTOR` |
| Aliases | `—` |

<!-- source facts: data/errcodes/0L000.json -->
<!-- END SQLSTATE FACTS -->

## Meaning {#meaning}

`0L000` is `invalid_grantor`. In `aclparse`, an ACL item without a `/grantor` suffix takes a backward-compatibility fallback: the parser sets the grantor to `BOOTSTRAP_SUPERUSERID` and emits `WARNING` with SQLSTATE `0L000`. This can occur while parsing ordinary ACL text; it does not identify bootstrap initialization. If a slash is present but no name follows it, the same parser instead raises `22P02` with `a name must follow the "/" sign`.

## Diagnosis {#diagnosis}

If this warning appears, inspect the ACL text being parsed and whether it contains a grantor suffix. A missing slash and an empty name after a slash are different inputs: the first takes the `0L000` compatibility warning, while the second takes `22P02`. A normal GRANT statement should be diagnosed with its concrete privilege or object error, such as 0LP01 or 42501.

## Response {#response}

Preserve or rewrite serialized ACL text with an explicit valid grantor when the text is under your control, then review the resulting ACLs. Do not treat the warning as proof that bootstrap initialization failed. This page records the source path only; no natural SQL trigger is selected for 0L000.

## Messages {#messages}

The fixed omitted-grantor branch emits `WARNING` with `0L000` and primary `defaulting grantor to user ID %u`; the numeric user ID is dynamic. The adjacent slash-without-name branch emits `ERROR` with `22P02` and primary `a name must follow the "/" sign`. A client exception without the server diagnostic is not proof of `0L000`.

## Representative case {#case}

This page has no selected natural SQL run. The structured evidence records a source or definition boundary; a client-side `RAISE` would not represent a backend mechanism.

## Versions {#versions}

The generated facts table records the locked catalogue snapshots and earliest observed definition. This page has no selected natural SQL run; the fixed REL_18_6/REL_10_23 `aclparse` source comparison must not be read as an observed runtime result or as a claim about every intermediate release.

## Related {#related}

- [`0LP01` — invalid_grant_operation](../0lp01/)
- [`42501` — related condition](../42501/)

## Sources {#sources}

- `src.aclparse-grantor-fallback.18.6` — `src/backend/utils/adt/acl.c` at `REL_18_6` commit `724edf9bde9d356724ad384a2e196edc3c9f80f7`; fixed blob SHA-256 `623f2dd01c1d393d3b224c7622dc2ec946faced444c1f5fd5e396e037903a5b0` ([source](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/acl.c#L408-L411)). This is the `aclparse` omitted-grantor compatibility branch.
- `src.aclparse-grantor-fallback.10.23` — `src/backend/utils/adt/acl.c` at `REL_10_23` commit `02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4`; fixed blob SHA-256 `3cfe29c06d211130552d2aab88f61dcdd9a5287c9ab8c450d48562056b32829e` ([source](https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/utils/adt/acl.c#L350-L353)). This is the `aclparse` omitted-grantor compatibility branch.
- `src.aclparse-slash-missing-name.10.23` — the same fixed `acl.c` blob, lines 338–344, records the separate `22P02` branch when `/` is followed by no name ([source](https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/utils/adt/acl.c#L338-L344)).
- `src.calls.REL_18_6` / `src.calls.REL_10_23` — fixed local call scans, SHA-256 `9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf` / `00d16d3eb01b71ccf1b245c8f3102f9d0ec9f36fb02777b8dd1b99fcb263040c`; these scans preserve the resolved call context used by the claims.
