Somehow I feel there is no need for plpgsql in what you are doing and that
indeed the ST_AsEwkt is too much.
I can't wrap my head around what this script is exactly trying to do
though. Can you elaborate a bit on your use-case? What is the original data
and what would you like to know from it?
Be
Hi,
I'm using pgplsql to calculate shortest distance between points. This works
but I'm wondering if my code is optimized because I'm using many ST_AsEwkt.
sqls='SELECT id code,ST_AsEwkt(ST_StartPoint(the_geom)) as
geom1,ST_AsEwkt(ST_EndPoint(the_geom)) as geom2 FROM ' || schem ||
'.trench';