Skip to content

Commit

Permalink
Fix the "readonly" option of IMPORT FOREIGN TABLE
Browse files Browse the repository at this point in the history
When set to "false", it would still create read-only foreign tables.

This closes #330 reported by Jacob Roberts.
  • Loading branch information
laurenz committed Jun 27, 2019
1 parent f12e2c0 commit 302eb0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ Version 2.2.0
Since PostgreSQL's "numeric" does not know infinity, map these values
to NaN in this case. For "real" and "double precision" we can use the
normal infinity values.
- The "readonly" option of IMPORT FOREIGN SCHEMA didn't work properly:
When set to "false", it would still create read-only foreign tables.
Reported by Jacob Roberts.

Version 2.1.0, released 2018-10-01
Enhancements:
Expand Down
12 changes: 6 additions & 6 deletions oracle_fdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2251,13 +2251,13 @@ oracleImportForeignSchema(ImportForeignSchemaStmt *stmt, Oid serverOid)
else if (strcmp(def->defname, "readonly") == 0)
{
char *s = ((Value *) (def->arg))->val.str;
if (pg_strcasecmp(s, "on") != 0
|| pg_strcasecmp(s, "yes") != 0
|| pg_strcasecmp(s, "true") != 0)
if (pg_strcasecmp(s, "on") == 0
|| pg_strcasecmp(s, "yes") == 0
|| pg_strcasecmp(s, "true") == 0)
readonly = true;
else if (pg_strcasecmp(s, "off") != 0
|| pg_strcasecmp(s, "no") != 0
|| pg_strcasecmp(s, "false") != 0)
else if (pg_strcasecmp(s, "off") == 0
|| pg_strcasecmp(s, "no") == 0
|| pg_strcasecmp(s, "false") == 0)
readonly = false;
else
ereport(ERROR,
Expand Down

0 comments on commit 302eb0c

Please sign in to comment.