Skip to content

pglite-socket: crash when creating a large enum value. #820

Description

@itsWill

I have a large enum value within my application with approx 1400~ values.

When it runs as a single CREATE TYPE public.big_enum as ENUM the database crashes with 2025-10-18 21:22:47.645 GMT [0] FATAL: terminating connection because protocol synchronization was lost

However when I break the enum into individual:

ALTER TYPE public.big_enum ADD VALUE 'rf_0000002';
ALTER TYPE public.big_enum ADD VALUE 'rf_0000003';

The db executes them without a problem.

Steps to Repdroduce:

Create a schema.sql file with entries up to 1000 values:

CREATE TYPE public.big_enum AS ENUM (
  'rf_0000001',
  'rf_0000002',
  'rf_0000003',
  'rf_0000004',
  'rf_0000005',
  'rf_0000006',
  'rf_0000007',
 ......
)

Run the database: npx pglite-server --path=/tmp/.s.PGSQL.5432 --debug=5 -d data

Load the schema file in through PGSSLMODE=disable psql -h /tmp -f schema.sql

The database will crash.

Converting the schema to individual ALTER TABLE statements then works.

I observed the same issue when a large insert.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions