Here is a question about changing serial value with alter
key word. Can this be done in create table defintion? Like that:
CREATE TABLE tablename (
colname SERIAL stars 1000
);
You can try this query.Its worked for me.
CREATE SEQUENCE tablename_colname_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1 ---> here you can mention startup nummber as you need
CACHE 1;
CREATE TABLE tablename (
colname integer NOT NULL DEFAULT nextval('tablename_colname_seq')
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With