Fix postgresql_fdw to avoid unnecessary call of GetForeignTable().
authorShigeru Hanada <[email protected]>
Mon, 8 Nov 2010 00:33:06 +0000 (09:33 +0900)
committerShigeru Hanada <[email protected]>
Mon, 8 Nov 2010 00:33:06 +0000 (09:33 +0900)
contrib/postgresql_fdw/postgresql_fdw.c

index 77ede71be10a7a7af260a63bd80df849223ac2e0..abeb2711260c0ec144276ba642da379b2d1207dd 100644 (file)
@@ -294,7 +294,7 @@ deparseSql(ForeignScanState *scanstate)
    StringInfoData  sql;
    ForeignScan    *scan;
    RangeTblEntry  *rte;
-   ForeignTable   *table;
+   ForeignTable   *table = scanstate->table;
    char           *nspname = NULL;
    char           *relname = NULL;
    const char     *nspname_q;
@@ -382,7 +382,6 @@ deparseSql(ForeignScanState *scanstate)
     * them in the foreign query.  Otherwise, use local catalog names.
     * Each identifier must be quoted if they are case sensitive.
     */
-   table = GetForeignTable(rte->relid);
    foreach(lc, table->options)
    {
        DefElem *opt = lfirst(lc);