4 ms·
There is one point I need to add it here. Note that I'm not DB expert, but I need to say why I prefer Postgres over Mysql. Create a table like the following:
by antoaravinth 9y ago
There is one point I need to add it here. Note that I'm not DB expert, but I need to say why I prefer Postgres over Mysql.
Create a table like the following:
create table user (name varchar(4));
MySql:
insert into user (name) values ('antoaravinth');
The above statement works even though I have given the size of my varchar as 4! And retrieving gives me `anto`!!
Postgres:
insert into user (name) values ('antoaravinth');
Stops me there with the relevant exception! That shows how Postgresql is doing small things right.
After seeing this, I never used MySql!
- sigi45 9y agoAs said in many other comments: This is because you used MySQL in non strict mode. You don't run MySQL on Production in non strict mode.
- koffiezet 9y agoTell that to developers who develop with the default config and then expect that to work in "Production".
- thehardsphere 9y agoAs said in many other comments, the idea that there is even a "strict mode" which was not on by default for many years is itself a problem and a red flag for other problems.