diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2009-12-23 12:23:59 +0000 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2009-12-23 12:23:59 +0000 |
commit | 4e766f2d176af92a8372b28a9ec2aa1eb8083063 (patch) | |
tree | 9b61b7489abe228b19aa85c4ad1ce408afa527e5 /src/backend/foreign/foreign.c | |
parent | b683908064e1fa4db26348ca43081dc6a99e3e4e (diff) | |
download | postgresql-4e766f2d176af92a8372b28a9ec2aa1eb8083063.tar.gz |
Always pass catalog id to the options validator function specified in
CREATE FOREIGN DATA WRAPPER. Arguably it wasn't a bug because the
documentation said that it's passed the catalog ID or zero, but surely
we should provide it when it's known. And there isn't currently any
scenario where it's not known, and I can't imagine having one in the
future either, so better remove the "or zero" escape hatch and always
pass a valid catalog ID. Backpatch to 8.4.
Martin Pihlak
Diffstat (limited to 'src/backend/foreign/foreign.c')
-rw-r--r-- | src/backend/foreign/foreign.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/foreign/foreign.c b/src/backend/foreign/foreign.c index 04f0d348fb..3fe7ac7449 100644 --- a/src/backend/foreign/foreign.c +++ b/src/backend/foreign/foreign.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/foreign/foreign.c,v 1.5 2009/06/11 16:14:18 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/foreign/foreign.c,v 1.6 2009/12/23 12:23:59 heikki Exp $ * *------------------------------------------------------------------------- */ @@ -372,7 +372,7 @@ is_conninfo_option(const char *option, Oid context) struct ConnectionOption *opt; for (opt = libpq_conninfo_options; opt->optname; opt++) - if ((context == opt->optcontext || context == InvalidOid) && strcmp(opt->optname, option) == 0) + if (context == opt->optcontext && strcmp(opt->optname, option) == 0) return true; return false; } @@ -409,7 +409,7 @@ postgresql_fdw_validator(PG_FUNCTION_ARGS) */ initStringInfo(&buf); for (opt = libpq_conninfo_options; opt->optname; opt++) - if (catalog == InvalidOid || catalog == opt->optcontext) + if (catalog == opt->optcontext) appendStringInfo(&buf, "%s%s", (buf.len > 0) ? ", " : "", opt->optname); |