Previous: , Up: postgres   [Contents][Index]


6.5.2 Postgres Query and SMAP Replies

Postgres SQL query and the smap replies are configured the same way as for mysql module (see MySQL Query and SMAP Replies). The following is a short summary:

query=template

Define the Postgres query template. The template may reference the following variables:

VariableMeaning
mapName of the map being queried
keyLookup key

Table 6.2: Postgres query template variables

If the database definition lacks the query option, it will attempt to use one from the module statement. If the module statement lacked it as well, an error is reported.

positive-reply=template

Defines a reply to be sent if the query returned a non-empty set of tuples. In addition to the variables described above (see Table 6.2), the template may also refer to the column names from the SQL result set.

The default positive-reply is ‘OK’.

negative-reply=template

Defines a reply to be sent if the query returned an empty set of tuples. The template may refer to the variables described in Table 6.2.

Default value is ‘NOTFOUND’.

onerror-reply=template

Defines a reply to be sent if an error occurred when executing the query. The template may refer to the variables described in Table 6.2.

Default value is ‘NOTFOUND’.