You have two problems here.
- Your internal representation is wrong, it's SRID 1, and it should be SRID 31287. Changing an internal representation is possible in every database: MySQL will get a mutator for it in version 8,
ST_SRID
, PostGIS hasST_SetSRID
- You need to actually convert from SRID 31287 to SRID 4326. This is possible ONLY in PostGIS. Neither MySQL nor Microsoft SQL can reproject an SRID.
To tackle the first problem in PostGIS, you'd use ST_SetSRID
, and to tackle the second problem you'd use ST_Transform
.