insert empty values instead of NULL in numeric fields

La Chupacabra

New Member
I need your help please.We have a PHP application running on MySQL, and we need to use PostgreSQL for a new customer.the problem is that when we insert empty strings in a field of type numeric, we get an error.I think we should actually use NULL instead of empty string.However we would like to avoid having to recode all the SQL code of our application, my question is whether it is possible in the structure of a table (or elsewhere) to ensure that our numeric column accepts empty values? or convert them to NULL?In the documentation I have seen that it is possible to define your own types, it is possible for example to create a type based on numeric and ensure that it accepts empty values?If yes how? I found no solutionThank you
 
Back
Top