cancel
Showing results for 
Search instead for 
Did you mean: 

Query on default serial(1) (auto increment)

Former Member
0 Kudos

Hi all,

1. is there a max integer value, when we create/add a column of type INTEGER?

if yes,

2. what happens when column value reaches that value?

- does it starts from 1 again or what happens?

Because, i want to create a table with a column of type INTEGER and it is enabled with auto increment and it is primary key. If i delete all rows(say, 100 rows) and insert values into it, it starts with 101... so i was wondering whether it starts with 1 again? or i should change the type of the column to some other type(VARCHAR()).

thank you,

regards,

sudhir.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi

try this sentence:

ALTER TABLE schemaname.tablename COLUMN colname DROP DEFAULT;

this eliminate default value and this recreate that value

ALTER TABLE schemaname.tablename COLUMN colname ADD DEFAULT SERIAL (integer value);

good luck

Answers (0)