I am having a two-column table trial(id serial, value text).
Then I use ALTER TABLE to change the data type of id to text, and still if I insert records like:
insert into trial(value) values('name');
Then serial is still getting incremented everytime I am adding rows into it. If I insert a row like
insert into trial values(111111111111....a very large number, 'name');
It still works and it still increments the serial counter.
My question is: why doesn't it overflow? Though the datatype of the column is text, the serial value would be still stored in a integer internally right? what is the data type of the variable that holds the serial value of a table(in psql's implementation) so that I can be sure that it would never overflow?
CREATE TABLEstatement?ids over 2147483647.serial.