Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- got this error: 'HINT: No function matches the given name and argument types. You might need to add explicit type casts.
- so I did:
- 1.alter table sp30_subset alter column arrivtime type timestamp using to_timestamp(arrivtime, 'YYYY-MM-DD hh24:mi:ss')::timestamp without time zone;
- 2.CREATE INDEX idx_sp30_subset_ts_inverse ON sp30_subset (user_id,geom, arrivtime, leavetime DESC);
- 3.CREATE INDEX idx_sp30_subset_funky ON sp30_subset USING gist (tsrange(arrivtime, leavetime, '[]'));
- 4.create temporary table mix as (select a.user_id id_x, a.arrivtime arriv_x, a.leavetime leav_x,
- h.user_id id_y, h.arrivtime arriv_y, h.leavetime leav_y from ali a, hasan h);
- 5.select * from mix where tsrange(arriv_y, leav_y,'[]') && tsrange(arriv_x, leav_x,'[]');
- ## how to call a function in plpgsql:
- func: sales_tax()
- select sales_tax("pr_id") from sp30_subset;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement