#ifndef	__MODPOSTGRESQL_H__
#define	__MODPOSTGRESQL_H__

#include <stdlib.h>
#include <string.h>
#include <libpq-fe.h>
#include <pg_config.h>
#ifdef	WIN32
# include <windows.h>
#else
# include <unistd.h>
#endif

#include "../mdamodule.h"

typedef	struct {
	PGconn *pgcon;
	char *lasterrormessage;
	char *string;
	char *dbname; /* if a connection string is used */
	mod_result *mod_result_head;
	mod_result *mod_result_tail;
	mod_config *cfg;
	size_t stringlen;
	int use_prefix;
	int inside_transaction;
	int last_errorcode;
	uint8_t status;
} mod_t;

#endif

