Skip to content

Error using parameters with ALTER SEQUENCE #436

@busslina

Description

@busslina

This does not works:

final res = await executor(
  Sql.named(
    'ALTER SEQUENCE auth.user_short_id_sequence RESTART WITH @newShortId',
    // 'ALTER SEQUENCE auth.user_short_id_sequence RESTART WITH 1200',
  ),
  parameters: {
    'newShortId': newShortId,
  },
);

newShortId is int.

Severity.error 42601: syntax error at or near "$1"

This works:

final res = await executor(
  Sql.named(
    // 'ALTER SEQUENCE auth.user_short_id_sequence RESTART WITH @newShortId',
    'ALTER SEQUENCE auth.user_short_id_sequence RESTART WITH 1200',
  ),
  // parameters: {
  //   'newShortId': newShortId,
  // },
);

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