Posts

Showing posts with the label sql

HINT: No function matches the given name and argument types. You might need to add explicit type casts.

It is common when using different versions of PostgreSQL, the name of the functions can change their name. In my particular case, migrating from version 9 to 12, the error appears with the following function LINE 10: select ST_Line_Interpolate_Point(geom,distance) as ge...                     ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. Just change the function name ST_Line_Interpolate_Point to: ST_LineInterpolatePoint Enjoy!

QGIS: How to solver issues to import view layers from sql

If you want to add to QGIS sql sentences, an easy way is to create views. You only need to convert your sql sentence like: select geom from links to create or replace view v_links as select geom from links But, you probably see the following error: Layer is not valid: The layer dbname='' host=0.0.0.0 port=5432 user='' password='' sslmode=disable key='""' type=Point table="public"."v_links" (point) sql= is not a valid layer and can not be added to the map. Reason:  This issue is because an index doesn't exist for data To solve it, just create an index as follows: create or replace view v_links as select row_number() OVER (order by geom), geom from links Enjoy it!