Remove unnecessary variables from postgresql_fdw.
authorShigeru Hanada <[email protected]>
Wed, 27 Oct 2010 04:31:55 +0000 (13:31 +0900)
committerShigeru Hanada <[email protected]>
Wed, 27 Oct 2010 05:10:23 +0000 (14:10 +0900)
contrib/postgresql_fdw/fsconnection.c
contrib/postgresql_fdw/fsconnection.h
contrib/postgresql_fdw/postgresql_fdw.c

index 3d55599ca3305b7320342f894200a72d6ee2cf18..214a3b4a232bcdcf0a08e7d8c22e4e0c6d507ad3 100644 (file)
@@ -29,8 +29,6 @@ typedef struct ConnCacheEntry
 {
    /* hash key must be first */
    char            name[NAMEDATALEN];  /* connection name; used as hash key */
-   Oid             serverid;           /* oid of foreign server */
-   Oid             userid;             /* oid of user (0 means PUBLIC) */
    FdwRoutine     *routine;
    PGconn         *conn;               /* foreign server connection */
 } ConnCacheEntry;
@@ -48,7 +46,6 @@ static HTAB *FSConnectionHash;
 void
 RegisterConnection(PGconn *conn,
                   ForeignServer *server,
-                  UserMapping *user,
                   const char *conname)
 {
    ForeignDataWrapper *wrapper;
@@ -58,7 +55,6 @@ RegisterConnection(PGconn *conn,
 
    AssertArg(conn != NULL);
    AssertArg(server != NULL);
-   AssertArg(user != NULL);
    AssertArg(conname != NULL);
    AssertArg(strlen(conname) < NAMEDATALEN);
 
@@ -71,8 +67,6 @@ RegisterConnection(PGconn *conn,
                (errcode(ERRCODE_DUPLICATE_OBJECT),
                 errmsg("connection \"%s\" already exists", conname)));
 
-   entry->serverid = server->serverid;
-   entry->userid = user->userid;
    entry->routine = routine;
    entry->conn = conn;
 }
index de6606df113701a172d8d9b83e0ed6c4c1cfb581..ab685d800bf83b04e59d8583fab783601bf7708a 100644 (file)
@@ -15,7 +15,7 @@
 #include "libpq-fe.h"
 
 /* managing connection cache */
-extern void RegisterConnection(PGconn *conn, ForeignServer *server, UserMapping *user, const char *conname);
+extern void RegisterConnection(PGconn *conn, ForeignServer *server, const char *conname);
 extern PGconn *GetConnectionByName(const char *conname);
 extern PGconn *UnregisterConnection(const char *conname);
 extern void DisconnectAll(void);
index 63434f9b670cfa5d0e3345025d9c3d877241e881..c319daa14aa50c103b8a7008d9d4220844e030fb 100644 (file)
@@ -154,7 +154,7 @@ pgConnectServer(ForeignServer *server, UserMapping *user)
    pfree(values);
 
    /* register the connection into connection cache. */
-   RegisterConnection(conn, server, user, server->servername);
+   RegisterConnection(conn, server, server->servername);
 
    return (FSConnection *) conn;
 }