payloadcms / payloadcms/payload
Push mode fails with 'type serial does not exist' error when connecting existing database
@r1tsuu is already working on this.
Since Feb 17, 2026.
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
Bug Report
Payload Version: 3.54.0
Database: PostgreSQL (Supabase) via @payloadcms/db-postgres
Description
When enabling push mode in development (push: true in postgresAdapter config), Payload attempts to run an invalid ALTER TABLE query that fails because PostgreSQL doesn't have a type called "serial".
Use Case & Impact
I'm connecting an existing database to Payload CMS and want to benefit from the push feature for rapid development. This bug makes it impossible to use push mode with an existing database, forcing me to use migrations instead - which defeats the purpose of having a push mode for quick iterations during development.
The push feature would be extremely valuable for:
- Syncing schema changes during development without manual migrations
- Quickly iterating on the CMS configuration
- Avoiding the overhead of migration files for every small change
Error Message
[Error: Failed query: ALTER TABLE "_products_v_rels" ALTER COLUMN "id" SET DATA TYPE serial;
params: ] {
query: 'ALTER TABLE "_products_v_rels" ALTER COLUMN "id" SET DATA TYPE serial;',
params: [],
payloadInitError: true,
[cause]: [error: type "serial" does not exist] {
severity: 'ERROR',
code: '42704',
file: 'parse_type.c',
line: '270',
routine: 'typenameType'
}
}
Current Database Schema
The column already has the correct structure:
SELECT column_name, data_type, column_default
FROM information_schema.columns
WHERE table_name = '_products_v_rels';
-- Result:
id | integer | nextval('_products_v_rels_id_seq'::regclass)
Root Cause
serial is a pseudo-type in PostgreSQL, not an actual data type. It's shorthand for creating an integer column with an auto-increment sequence. The correct type for the column is integer, which is already set correctly in the database.
Payload's push mode is trying to ALTER the column to type serial, which is invalid SQL.
Expected Behavior
Push mode should:
- Recognize that
serialis not a real PostgreSQL type - Understand that
integerwith a sequence (nextval()) is the correct equivalent - Skip this ALTER TABLE operation when the column is already configured correctly
Current Workaround
Disable push mode: push: false and use migrations instead - but this removes the entire value proposition of push mode for development.
Configuration
db: postgresAdapter({
pool: {
connectionString: process.env.DATABASE_URI,
ssl: { rejectUnauthorized: false },
},
push: true, // This triggers the error
})
This is particularly frustrating when working with existing databases where we want the convenience of push mode during development.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.