File: 16-sequences.sql

package info (click to toggle)
pgcopydb 0.17-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 30,636 kB
  • sloc: ansic: 217,474; sql: 1,654; sh: 812; makefile: 365; python: 94
file content (23 lines) | stat: -rw-r--r-- 793 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
--- See https://github.com/dimitri/pgcopydb/issues/777
---

-- A sequence used as default
create sequence default_table_id_seq;
create table default_table (id integer primary key default nextval('default_table_id_seq'));
select setval('default_table_id_seq', 667);

-- A sequence used as identity
create table identity_table (id integer primary key generated always as identity);
select setval('identity_table_id_seq', 668);

-- A standalone sequence
create sequence standalone_id_seq;
select setval('standalone_id_seq', 669);

-- A standalone sequence smallint
create sequence standalone_smallint_id_seq as smallint;
select setval('standalone_smallint_id_seq', 670);

-- A standalone sequence with a minvalue that has not been set
create sequence standalone_minvalue_id_seq minvalue 671;