The parentheses are misplaced:
SELECT setval('payments_id_seq', 21, true); -- next value will be 22
Otherwise you’re calling setval
with a single argument, while it requires two or three.
This is the same as SELECT setval('payments_id_seq', 21)
More Related Contents:
- Safely rename tables using serial primary key columns
- Simulate CREATE DATABASE IF NOT EXISTS for PostgreSQL?
- DROP FUNCTION without knowing the number/type of parameters?
- PostgreSQL create table if not exists
- PostgreSQL: Give all permissions to a user on a PostgreSQL database
- Sort by column ASC, but NULL values first?
- Using an Alias column in the where clause in Postgresql
- Grouped LIMIT in PostgreSQL: show the first N rows for each group?
- Reset auto increment counter in postgres
- Optimize query with OFFSET on large table
- How to concatenate columns in a Postgres SELECT?
- Delete column from SQLite table
- updating table rows in postgres using subquery
- How can I send email from PostgreSQL trigger?
- Find overlapping date ranges in PostgreSQL
- PostgreSQL multi INSERT…RETURNING with multiple columns
- How do you do date math that ignores the year?
- Get the distinct sum of a joined table column
- How much disk-space is needed to store a NULL value using postgresql DB?
- Is it possible to run multiple DDL statements inside a transaction (within SQL Server)?
- Aggregate a single column in query with many columns
- Aggregating (x,y) coordinate point clouds in PostgreSQL
- PostgreSQL convert columns to rows? Transpose?
- Regular expression in PostgreSQL LIKE clause
- Postgres Error: More than one row returned by a subquery used as an expression
- Generate DEFAULT values in a CTE UPSERT using PostgreSQL 9.3
- Postgresql query between date ranges
- How to use SQL LIKE condition with multiple values in PostgreSQL?
- Drop column from SQLite table
- Why isn’t row level security enabled for Postgres views?