Browse files

Fix small bug on "create foreign data wrapper" statement.

When an option value contains the '=' character, the code would fail because opt.split('=') would return a list bigger than 2 items.
  • Loading branch information...
1 parent 6244b07 commit 3ed7759e923df871e7e07d802943b69c58e66a3d Ronan Dunklau committed Mar 5, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 pyrseas/dbobject/foreign.py
View
2 pyrseas/dbobject/foreign.py
@@ -27,7 +27,7 @@ def create(self):
if hasattr(self, 'options'):
opts = []
for opt in self.options:
- (nm, val) = opt.split('=')
+ (nm, val) = opt.split('=', 1)
opts.append("%s '%s'" % (nm, val))
clauses.append("OPTIONS (%s)" % ', '.join(opts))
stmts = ["CREATE FOREIGN DATA WRAPPER %s%s" % (

0 comments on commit 3ed7759

Please sign in to comment.