small dblink patch - Mailing list pgsql-patches

From Joe Conway
Subject small dblink patch
Date
Msg-id 3CF1BEAD.4010702@joeconway.com
Whole thread Raw
Responses Re: small dblink patch  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Please apply the attached small patch, which fixes a schema related
issue with several dblink functions.

- If the same relation exists in multiple schema, current sources fail
to resolve an unqualified relname.
- Current sources do not allow schema qualified names.

The patch fixes both issues by using the (relatively new) regclassin()
function to resolve the relname to an Oid.

Thanks,

Joe
Index: contrib/dblink//dblink.c
===================================================================
RCS file: /opt/src/cvs/pgsql/contrib/dblink/dblink.c,v
retrieving revision 1.6
diff -c -r1.6 dblink.c
*** contrib/dblink//dblink.c    20 May 2002 23:51:40 -0000    1.6
--- contrib/dblink//dblink.c    27 May 2002 04:30:22 -0000
***************
*** 1346,1352 ****
  #ifdef NamespaceRelationName
      Oid                relid;

!     relid = RelnameGetRelid(relname);
  #else
      Relation        rel;
      Oid                relid;
--- 1346,1352 ----
  #ifdef NamespaceRelationName
      Oid                relid;

!     relid = DatumGetObjectId(DirectFunctionCall1(regclassin, CStringGetDatum(relname)));
  #else
      Relation        rel;
      Oid                relid;

pgsql-patches by date:

Previous
From: Bear Giles
Date:
Subject: SSL (patch 10)
Next
From: Tom Lane
Date:
Subject: Re: small dblink patch