Skip to content

Admin: Filtering on relationship field returns invalid input syntax error #11603

Open
@harolrodriguez

Description

@harolrodriguez

Link to reproduction

https://github.com/payloadcms/website

Describe the Bug

When applying a filter to a relationship field in Payload CMS, the query is processed incorrectly, causing a syntax error in PostgreSQL.

Error message:

invalid input syntax for type integer: "{"2","2"}"

To Reproduce

Steps to reproduce the behavior:

  1. Install Payload CMS demo using:
    npx create-payload-app@latest my-app
  2. Select demo during setup and run the seed without modifications.
  3. Configure the project to use PostgreSQL as the database.
  4. Go to the Payload Web admin panel.
  5. Navigate to the "Posts" collection.
  6. Apply a filter on a relationship field.
Screen.Recording.2025-03-09.at.3.38.59.PM.mov

Image

.

Payload Version

3.27.0

Adapters and Plugins

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions