Skip to main content
Question

Postgres writer: is it possible to add a sql function to an attribute?

  • December 13, 2019
  • 2 replies
  • 10 views

giosp
Contributor
Forum|alt.badge.img+6
  • Contributor

Hi to all,

I'd like to add to my insert procedure a specific sql function for example add a to_tsvector(my_column). I've tried to add it in different manners but the result is always my value with the function name written in the column. Is it possibile to do what I want with a writer or I have to use an SQLExecutor and write my desired insert statemenet?

Thank you

2 replies

redgeographics
Celebrity
Forum|alt.badge.img+48

You can add a SQL query to be executed before or after writing (that's in the Navigator under the advanced writer parameters)

But that's on a per-run basis, if you want to do something per feature a SQLExecutor is probably the way to go.


giosp
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • December 13, 2019

Thank you for your reply. What I like to do is:

insert into tsearch (label,layer_name,role_id,public,ts,geom) 
values
('@Value(name)', '@Value(_layer)', 1, trueto_tsvector('@Value(name)'), geom)

With "sql to run before/after" is not possible.

I will use SQLExecutor.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings