0

Having a hard time working out what do I need to do to insert this export from MySQL:

INSERT INTO cities VALUES ('Nameoftheciy',0x0000000001010000005C21ACC6129C48407AFF1F274CA65EC0);

I tried wrapping the value in single quotes or extracting the data as POINT() but it also returns an errors in PostgreSQL.

What is the right approach here?

Moseleyi
  • 2,585
  • 1
  • 24
  • 46
  • tried this? `SELECT ST_AsEWKT( replace('0x0000000001010000005C21ACC6129C48407AFF1F274CA65EC0','0x','\x')::bytea::geometry(point,4326));` – Jim Jones Jul 27 '22 at 21:05
  • This one complains that `geometry type doesn't exist` – Moseleyi Jul 27 '22 at 21:27
  • I will delete the answer for the time being, as it serves no purpose for your issue. Consider using a standard format like `wkt`, `geojson`, or `gml`. Some time ago a guy had a [similar problem](https://stackoverflow.com/a/59447658/2275388) and WKT did solve the issue. – Jim Jones Jul 27 '22 at 21:35
  • did you install the postgis extension? – Ian Turton Jul 28 '22 at 07:19
  • I was told today that Postgis library is not and will not be enabled on my server :/ – Moseleyi Jul 28 '22 at 17:56

0 Answers0