1

It seems that PostgreSQL sintax doesn´t work. Any suggestions?

enter image description here

  • Try AND instead of a comma – MrXsquared Jan 11 at 21:13
  • Default value for a key/value control doesn´t use a "logical" expression. It needs a valid value for the data type (5 for integer, "text" for string, etc.). The problem is the sintax for the hstore field in the PostgreSQL table that I am using. – jrosleo Jan 11 at 23:44
  • 1
    try with map_to_hstore( map( 'key', 'value' ) ) ... can't validate right now, so no answer. the relevant functions (Expression String Builder) are in the Maps section. – ThingumaBob Jan 12 at 8:09
  • I have tried but it doesn´t work. But if I check "apply default value on update" and I change another field value, and save layer, it works properly. So maybe it could be a bug? – jrosleo Jan 14 at 8:36
2

This UI field is a QGIS expression, not a postgresql expression. To build a map in a QGIS expression, use the map function:

map('fieldname1', 'value1', 'fieldname2', 'value2')

The ε button is your friend...

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.