Answer the question
In order to leave comments, you need to log in
How to set a default value in PgSQL?
what is the problem?
why is the default value not being set?
"it is written, etc", it is written that it is not possible to set an integer, but why?
Answer the question
In order to leave comments, you need to log in
It is written in English:
The existing values in the ip column cannot be automatically converted to the integer type. Use USING to cast the old type to the new one.
ALTER TABLE the_table ALTER COLUMN col_name TYPE integer USING (col_name::integer);
thanks, I already tried it, the trouble is that you can’t translate from cidr to integer, I had to recreate the table, thanks for the help )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question