Previous: Postgres Configuration, Up: postgres [Contents][Index]
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:
Define the Postgres query template. The template may reference the following variables:
Variable | Meaning |
---|---|
map | Name of the map being queried |
key | Lookup key |
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.
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’.
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’.
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’.