Independent technical referenceOfficial site
  • Software and digital services
  • Databases

22023

PostgreSQL 22023 invalid_parameter_value: rejected argument

Verified with sources2 sourcesReviewed Oct 19, 2026
Technician coming? See the 2 steps they must show you
Trace

Risk level

Low

Usually safe to check without specialist tools.

Urgency

Medium

Quick answer

PostgreSQL returns SQLSTATE 22023 (invalid_parameter_value) when a function argument, SQL command option, or run-time configuration parameter receives an unsupported value or unit. Check the error Detail and Hint fields and inspect pg_settings before retrying.

Safety first

Stop and check this first

  • Never manually edit postgresql.auto.conf while the server is running, disable durability settings such as fsync, or grant superuser privileges just to force a parameter change: Section 19.1.2 warns that postgresql.auto.conf is meant to be edited automatically via ALTER SYSTEM and concurrent commands can overwrite manual edits.
  • Do not attempt to run additional SQL commands in a transaction block that failed with 22023 before executing ROLLBACK, and always redact passwords, connection strings, and personal data before sharing logs.

Safe checks you can perform

  • Read the ErrorResponse Message, Detail, Hint, and Where fields to identify the rejected parameter
  • Query pg_settings and SHOW to check allowed enumvals, unit, and bounds for a configuration parameter
  • Inspect pg_file_settings or function arguments with pg_get_function_arguments

Leave these tasks to a qualified professional

  • Do not attempt this professional task: Correct the configuration parameter syntax, case-sensitive unit, or enum value
  • Do not attempt this professional task: Validate function arguments at the application boundary before calling PostgreSQL

What a technician must be able to justify

Technician visit

These are the steps they must carry out and show you. Tick them as they work: if steps are skipped, do not accept a part swap.

These are not instructions for opening or handling the equipment yourself. They are the checks that should support a technical conclusion.

  1. Correct the configuration parameter syntax, case-sensitive unit, or enum value

    What they doHave the DBA or developer update the SET command, PGOPTIONS string, or configuration file to use a value within min_val and max_val, an exact enum option from pg_settings.enumvals, or a properly quoted case-sensitive unit (B, kB, MB, GB, TB or us, ms, s, min, h, d), then reload with pg_ctl reload or SELECT pg_reload_conf().

    They must show youthe pg_settings row and SHOW output confirming the parameter accepted the new value without errors in pg_file_settings.

    In writingthe exact parameter name, previous and new values, and where the setting was applied (session, role, database, or cluster).

  2. Validate function arguments at the application boundary before calling PostgreSQL

    What they doWhen 22023 comes from a built-in or PL/pgSQL function call, have the developer validate the parameter against the function's documented domain in application code before executing the SQL statement, and issue ROLLBACK if a transaction block aborted.

    They must show youa read-only test query demonstrating that valid boundary arguments succeed and invalid arguments are rejected before reaching the database.

    In writingthe validation rule added for the function parameter and the test results.

Before accepting a part or repair

Nothing has been shown yet. Do not accept a part swap based on the code alone.

Follow these steps

Note: Follow the documented order. An error code identifies the affected system, but it does not prove by itself which part has failed.

  1. Read the ErrorResponse Message, Detail, Hint, and Where fields to identify the rejected parameter

    No special tools

    Who:
    Your developer or DBA inspecting the failed command or function call for 22023.
    How:
    Capture ErrorResponse fields C (22023), M (Message), D (Detail), H (Hint), P (Position), q (Internal query), and W (Where) from the client driver or server log after redacting passwords and personal data.
    Result that matters:
    Message names the rejected parameter or function argument, while Detail and Hint often list the valid values, units, or expected range, and Where traces any enclosing PL/pgSQL function.
    If Message and Hint list valid values or units for a run-time setting, that confirms a SET, ALTER, or startup configuration parameter triggered 22023.
    If Position (P) or Where (W) points to a SQL function call in a query, that isolates the error to a data argument passed into that function rather than a server configuration setting.
    Evidence to keep:
    Save the redacted ErrorResponse fields C, M, D, H, P, q, and W with the exact command text.

    Evidence: PostgreSQL 18 Appendix A: Error Codes · PostgreSQL error and notice fields

  2. Query pg_settings and SHOW to check allowed enumvals, unit, and bounds for a configuration parameter

    Tools required

    Who:
    Your DBA or developer checking a run-time parameter that failed with 22023.
    How:
    Issue ROLLBACK first if your session transaction is aborted, then run SHOW name; or query pg_settings for name, setting, unit, vartype, min_val, max_val, and enumvals for the parameter named in the error.
    Result that matters:
    Section 19.1.1 and Section 19.1.3 state that pg_settings exposes the parameter's default unit, allowed enumvals, and current session setting.
    If vartype is enum and the supplied string is not listed in pg_settings.enumvals, that confirms an unrecognized enumerated option caused 22023.
    If the parameter takes a memory or time unit and the caller passed an unquoted value or wrong-case unit (for example kb or mb instead of kB or MB), that confirms a unit syntax mismatch under Section 19.1.1.
    Evidence to keep:
    Record the pg_settings row (name, setting, unit, vartype, min_val, max_val, enumvals) for the parameter.

    Use only read-only SHOW and SELECT queries on pg_settings; never edit postgresql.auto.conf manually while the server is running.

    Evidence: PostgreSQL ROLLBACK · PostgreSQL 18 SHOW · PostgreSQL 18 Section 19.1: Setting Parameters

  3. Inspect pg_file_settings or function arguments with pg_get_function_arguments

    Tools required

    Who:
    Your DBA or developer verifying configuration files or SQL function signatures.
    How:
    For configuration reload issues, query pg_file_settings to see if a configuration file entry was flagged; for function calls, query pg_get_function_arguments(to_regprocedure('func_signature')) and inspect the runtime argument values.
    Result that matters:
    Section 19.1.2 notes that pg_file_settings diagnoses configuration file problems, while Table 9.76 shows pg_get_function_arguments reconstructs the argument list and defaults of a function.
    If pg_file_settings shows an error on a line in postgresql.conf or postgresql.auto.conf, that confirms an invalid parameter setting in the configuration file was logged and ignored during SIGHUP reload.
    If pg_file_settings is clean and the failure occurs inside a query, comparing the runtime inputs against the function's documented parameter rules isolates the offending argument value.
    Evidence to keep:
    Keep the pg_file_settings output or the pg_get_function_arguments signature along with the redacted argument values.

    Do not restart the database server or grant superuser privileges to work around a parameter error; test parameter changes in a local session first.

    Evidence: PostgreSQL 18 system information functions · PostgreSQL 18 Section 19.1: Setting Parameters

Still not solved

If the error persists, stop here. See what the technician must do and show you.

Virtual technician

Does 22023 still appear after these checks?

This guided flow uses the exact code and your answers to choose a test, an expected result and the next branch.

Where this code applies

A code is meaningful only inside the right product and version context.

Primary scope

System
Software and digital services
Brand
PostgreSQL
Product type
Databases

Known code variants

  • invalid_parameter_value
  • PostgreSQL 22023
  • SQLSTATE 22023

What it means

In Appendix A Table A.1, the PostgreSQL server maps 22023 to invalid_parameter_value in Class 22 Data Exception. The server raises this condition when a function, SQL command, or parameter assignment (SET, ALTER SYSTEM, ALTER DATABASE, or ALTER ROLE) receives an argument whose value, unit, or option violates documented rules. Section 19.1.1 explains that configuration parameters take boolean, string, integer, floating-point, or enumerated values, memory and time units (kB, MB, GB, ms, s, min) are case-sensitive, and allowed enum choices appear in pg_settings.enumvals. Code 22023 alone does not prove a server fault.

Warnings and stop conditions

  • Mediumsource verified

    Never manually edit postgresql.auto.conf while the server is running, disable durability settings such as fsync, or grant superuser privileges just to force a parameter change: Section 19.1.2 warns that postgresql.auto.conf is meant to be edited automatically via ALTER SYSTEM and concurrent commands can overwrite manual edits.

    Evidence: PostgreSQL 18 Section 19.1: Setting Parameters

  • Lowsource verified

    Do not attempt to run additional SQL commands in a transaction block that failed with 22023 before executing ROLLBACK, and always redact passwords, connection strings, and personal data before sharing logs.

    Evidence: PostgreSQL error and notice fields · PostgreSQL ROLLBACK

Symptoms and causes

Probable causes · in order

  • Run-time configuration parameter assigned an invalid enum option, out-of-bounds number, or wrong-case unitCommon

    Section 19.1.1 states that enumerated parameters are restricted to the values in pg_settings.enumvals and numeric unit names (B, kB, MB, GB, TB and us, ms, s, min, h, d) are case-sensitive and must be quoted when written with a number.

    Evidence: PostgreSQL 18 Appendix A: Error Codes · PostgreSQL 18 Section 19.1: Setting Parameters

  • Built-in or procedural SQL function called with an argument value or option combination outside its domainCommon

    A SQL function, operator, or command received an argument of the expected data type whose runtime value (such as an unsupported encoding name, invalid flag, or disallowed range) is rejected by the function.

    Evidence: PostgreSQL 18 Appendix A: Error Codes · PostgreSQL error and notice fields

  • Session startup or connection string passing an invalid setting via PGOPTIONS or ALTER ROLE / ALTER DATABASEPossible

    Section 19.1.3 and Section 19.1.4 explain that parameter overrides can be attached via ALTER DATABASE, ALTER ROLE, or the libpq PGOPTIONS environment variable (-c name=value), causing 22023 if an invalid value is supplied.

    Evidence: PostgreSQL 18 SHOW · PostgreSQL 18 Section 19.1: Setting Parameters

Sources and technical references

  1. 1

    PostgreSQL 18 Appendix A: Error Codes

    PostgreSQL Global Development Group · 2026 · official_doc

  2. 2

    PostgreSQL error and notice fields

    PostgreSQL Global Development Group · 2026 · official_doc

Sources: PostgreSQL 18 Appendix A: Error Codes · PostgreSQL error and notice fieldsreviewed 2026-10-19 · verified

Was this entry useful?