Closed Qtianv587 closed 6 years ago
Have you tried entering a SQL query instead of just the table name? Also, is your connection local or is it on a remote machine? I'm assuming the latter, because you have a host value. Have you verified the connection is good, and not causing problems?
@Qtianv587 Were you able to solve this? Can you post back your solution, to help others?
Well, I have solved this. Actually the problem is obvious.
ERROR: function st_srid(bytea) is not unique
shows that there is not only one function called "st_srid()" in postgis database.
You might need to add explicit type casts
shows that we need add explicit type casts to the parameters in function st_srid().
Sadly the SQL is embedded in TileMill and we can't edit it, so we need try other ways.
There are two ways to handle it and I recommend the second way:
Change the parameter "table or subquery".
I filled a table name "river" before. Replace the table name "river" with a subquery:
(select "wkb_geometry" :: geometry from river) as data
Delete or change other functions which have the same name called st_srid() in postgis database.
The first way helps us cast the field or parameter wkb_geometry
to an explicit type geometry
. But we can query only wkb_geometry
data. If we need other fields' data, we must add fields in subquery like:
(select "wkb_geometry" :: geometry, "ogc_fid" from river) as data
If there is a large amount of fields, it's hard to edit the subquery.
And when we need add postgis data in mapnik, the first way is inoperative.
So I recommend the second way. I use the pgAdmin4 to change function's name manually.
Thanks for posting an update with your resolution.
I tried to add a postgis layer and I filled the parameters like this:
Other parameters remains blank.
And the error message is:
I tried all ways to handle it but failed. Can someone solve this? @springmeyer