Skip to content

cursor pagination throws "column cursor does not exist" with PostgreSQL #1128

@Momen-devv

Description

@Momen-devv

Bug Report

Description

When using PaginationType.CURSOR with PostgreSQL, the query fails with:

QueryFailedError: column "cursor" does not exist

Reproduction

Entity:

@Entity()
export class Todo {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @CreateDateColumn()
  createdAt: Date;
}

Expected Behavior

Cursor pagination should work using createdAt as the cursor column.

Actual Behavior

PostgreSQL throws column "cursor" does not exist, meaning the library
is passing cursor as a raw SQL column name instead of handling it
as a query parameter.

Stack Trace

QueryFailedError: column "cursor" does not exist
    at async paginate (nestjs-paginate/src/paginate.ts:923)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions