From: Eric Leblond Date: Wed, 1 Aug 2012 11:27:15 +0000 (+0000) Subject: pgsql: only disable key if it starts with underscore X-Git-Tag: ulogd-2.0.1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72c935c08d4e414c892fdc3a8aa8163c1c07cebb;p=thirdparty%2Fulogd2.git pgsql: only disable key if it starts with underscore ulogd2 was magically making inactive the first key of description table. This patch improves this system by only doing so when the key start with an undescore. This way, system like nfacct which do not have a primary key can be implemented easily. Signed-off-by: Eric Leblond Signed-off-by: Pablo Neira Ayuso --- diff --git a/output/pgsql/ulogd_output_PGSQL.c b/output/pgsql/ulogd_output_PGSQL.c index 9529b1c..57206f4 100644 --- a/output/pgsql/ulogd_output_PGSQL.c +++ b/output/pgsql/ulogd_output_PGSQL.c @@ -195,8 +195,9 @@ static int get_columns_pgsql(struct ulogd_pluginstance *upi) strncpy(upi->input.keys[i].name, buf, ULOGD_MAX_KEYLEN); } - /* ID is a sequence */ - upi->input.keys[0].flags |= ULOGD_KEYF_INACTIVE; + /* ID (starting by '.') is a sequence */ + if (upi->input.keys[0].name[0] == '.') + upi->input.keys[0].flags |= ULOGD_KEYF_INACTIVE; PQclear(pi->pgres); return 0;