libgpgsqlbackend_la_SOURCES=gpgsqlbackend.cc gpgsqlbackend.hh \
spgsql.hh spgsql.cc
-libgpgsqlbackend_la_LDFLAGS=@PGSQL_lib@ -Wl,-Bstatic -lpq++ -lpq \
+libgpgsqlbackend_la_LDFLAGS=@PGSQL_lib@ -Wl,-Bstatic -lpq \
-Wl,-Bdynamic
libgpgsqlbackend_la_LIBADD=-lssl -lcrypt -lcrypto
-// $Id: gpgsqlbackend.cc,v 1.4 2004/09/13 19:07:00 ahu Exp $
#include <string>
#include <map>
try {
setDB(new SPgSQL(getArg("dbname"),
getArg("host"),
+ getArg("port"),
getArg("socket"),
getArg("user"),
getArg("password")));
declare(suffix,"dbname","Pdns backend database name to connect to","powerdns");
declare(suffix,"user","Pdns backend user to connect as","powerdns");
declare(suffix,"host","Pdns backend host to connect to","");
+ declare(suffix,"port","Database backend port to connect to","");
declare(suffix,"socket","Pdns backend socket to connect to","");
declare(suffix,"password","Pdns backend password to connect with","");
-/* Copyright 2003 Netherlabs BV, bert.hubert@netherlabs.nl. See LICENSE
- for more information.
- $Id: spgsql.cc,v 1.4 2004/01/17 13:18:22 ahu Exp $ */
+/* Copyright 2003 - 2005 Netherlabs BV, bert.hubert@netherlabs.nl. See LICENSE
+ for more information. */
#include <string>
#include "spgsql.hh"
bool SPgSQL::s_dolog;
-SPgSQL::SPgSQL(const string &database, const string &host, const string &msocket, const string &user,
+SPgSQL::SPgSQL(const string &database, const string &host, const string& port, const string &msocket, const string &user,
const string &password)
{
d_db=0;
if(!host.empty())
connectstr+=" host="+host;
+ if(!port.empty())
+ connectstr+=" port="+port;
+
if(!password.empty())
connectstr+=" password="+password;
-/* Copyright 2001 Netherlabs BV, bert.hubert@netherlabs.nl. See LICENSE
- for more information.
- $Id: spgsql.hh,v 1.5 2004/01/17 13:18:22 ahu Exp $ */
+/* Copyright 2001 - 2005 Netherlabs BV, bert.hubert@netherlabs.nl. See LICENSE
+ for more information. */
#ifndef SPGSQL_HH
#define SPGSQL_HH
using namespace std;
class SPgSQL : public SSql
{
public:
- SPgSQL(const string &database, const string &host="",
+ SPgSQL(const string &database, const string &host="", const string& port="",
const string &msocket="",const string &user="",
const string &password="");