Correct DbConnection instantiations as a result of commit 78aa961.

 * pyrseas/testutils.py (PostgresDb.{execute_and_map,proces_map): Used
   named parameters for host and port since commit 78aa961 inserted
   extra positional argument.
Exclude database-wide objects from yamltodb -n. Fixes #21.
Correct version number for 0.4.1 in NEWS file.
Change DROP COLUMN to handle DROP ATTRIBUTE if applicable.  Fixes #22.

 * pyrseas/dbobject/column.py (Column.drop): If Column object not attached
   to table, issue ALTER TYPE DROP ATTRIBUTE statement instead.
Implement support for foreign data wrappers, servers and user mappings.

 * docs/foreign.rst: Document new objects.
 * docs/index.rst: Add foreign.rst.
 * pyrseas/database.py (Database.Dicts.__init__): Add dictionaries for
   new objects.  (Database.from_map): Process new input objects.
   (Database.diff_map): Call diff_map's for new objects.
 * pyrseas/dbobject/foreign.py: Add classes for new objects.
 * pyrseas/testutils.py (PostgresDb.clear): Drop existing FDWs,
   servers and user mappings.
 * tests/dbobject/__init__.py: Invoke new test module.
 * tests/dbobject/test_foreign.py: New test module.
Replace optparse by argparse, and allow spec to yamltodb to come from stdin.

 * docs/cmdargs.rst: New page for common command line options.
 * docs/dbtoyaml.rst: Move common options to new page.
 * docs/index.rst: Add extender in Features, argparse in Requirements,
   cmdargs in Contents.
 * docs/yamltodb.rst: Move common options to new page.  Indicate spec
   argument can be omitted and will use stdin instead.  Add new
   examples.
 * pyrseas/cmdargs.py: New module to define parent_parser function.
 * pyrseas/{dbtoyaml.py,yamltodb.py}: Replace optparse by argparse and
   move common arguments to new parent_parser.
Add Connection options group to parent_parser in pyrseas/cmdargs.py.
Changes to make Pyrseas tests run under Python 3.2.

 * pyrseas/database.py (flatten): Replace basestring by str.
 * pyrseas/dbobject/__init__.py: Replace string.lowercase by
   string.ascii_lowercase.
 * pyrseas/dbobject/constraint.py (ConstraintDict.from_map): Use
   list() around dict.keys().
 * pyrseas/dbobject/function.py (ProcDict.diff_map): Replace
   basestring by str.
 * pyrseas/dbobject/index.py (Index.key_columns): Replace basestring
   by str. Use list() to wrap dict.keys() and dict.values().
 * pyrseas/dbobject/schema.py (SchemaDict.from_map): No need to remove
   oldname from input schema.
 * pyrseas/dbobject/table.py (MAX_BIGINT): Remove trailing 'L'.
   (Sequence.to_map): Replace sys.maxint by sys.maxsize, test for
   int/long under Python 2 and for int only under Python 3.
 * tests/dbobject/test_constraint.py
   (ForeignKeyToMapTestCase.test_foreign_key_deferred): Replace
   assert_ by AssertTrue.
 * setup.py: Add several Python classifiers and change development
   status to beta.
Change 'username' destination to the 'username' attribute instead of user, since that's what is used in the code.
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.
Merge pull request #23 from rdunklau/patch-1

Change 'username' destination
Merge pull request #24 from rdunklau/patch-2

Fix small bug on "create foreign data wrapper" statement.
Add support for PG 9.1 foreign tables.

 * docs/foreign.rst: Document new features.
 * pyrseas/database.py (Database.Dicts.__init__): Add dictionary for
   foreign tables. (Database.link_refs): Add foreign tables to
   schemas.link_refs and add ftables.link_refs. (Database.diff_map):
   Call diff_map for foreign tables.
 * pyrseas/dbobject/column.py (ColumnDict.query): Retrieve foreign
   table columns.
 * pyrseas/dbobject/foreign.py: Add ForeignTable and ForeignTableDict
   class to implement new features.  Add options_clause helper
   function to abstract creation of OPTIONS clauses.
 * pyrseas/dbobject/schema.py (Schema.to_map): Add ftables to
   objtypes.  (SchemaDict.from_map): Process foreign tables in input.
   (Schema.link_refs): Link foreign tables to their schemas.
 * pyrseas/testutils.py (PostgresDb.clear): Drop foreign tables if
   they exist.
 * tests/dbobject/test_foreign.py: Add new test cases for foreign
   tables.
Change foreign servers to be listed under their wrappers in YAML output.

 * docs/foreign.rst: Add new automethods.
 * pyrseas/database.py (Database.link_refs): Link servers to their FD
   wrappers.  (Database.from_map): Remove mapping of input servers.
   (Database.to_map): Remove mapping of servers.
 * pyrseas/dbobject/foreign.py (ForeignDataWrapper.to_map): New method
   to output servers as part of their wrappers.
   (ForeignDataWrapperDict.from_map): Handle servers as this level.
   (ForeignDataWrapperDict.link_refs): New method to link servers and
   wrappers.  (ForeignServer.identifier): New method.
   (Foreign.ServerDict.query): Order by FDW first.
   (ForeignServerDict.from_map): Use FDW as part of key.
 * tests/dbobject/test_foreign.py: Adjust tests to new input and
   output.
Change user mappings to be listed under their servers in YAML output.

 * docs/foreign.rst: Add new automethods.
 * pyrseas/database.py (Database.link_refs): Link user mappings to
   their servers.  (Database.from_map): Remove mapping of input user
   mappings.  (Database.to_map): Remove mapping of user mappings.
 * pyrseas/dbobject/foreign.py (ForeignDataWrapperDict.from_map): Add
   newdb argument to downstream call.  (ForeignServer.to_map): New
   method to output user mappings as part of their servers.
   (ForeignServer.from_map): Handle user mappings as this level.
   (ForeignServerDict.link_refs): New method to link mappings and
   servers.  (ForeignServer.extern_key): Change output format.
   (Foreign.UserMappingDict.query): Add join to
   pg_foreign_data_wrapper and change sort order.
   (UserMappingDict.from_map): Change arguments and reorganize for new
   input.  (UserMappingDict.diff_map): Change key tuples.
 * tests/dbobject/test_foreign.py: Adjust tests to new input and
   output.
Correct order of creation/destruction of FDW-related objects.

 * pyrseas/database.py (Database.diff_map): Reorder calls and add
   calls to drop servers and FDWs.
 * pyrseas/dbobject/foreign.py (ForeignDataWrapperDict.diff_map): Mark
   wrappers to be dropped.  (ForeignDataWrapperDict._drop): New method
   to actually drop the wrappers.  (ForeignServerDict.diff_map): Mark
   servers to be dropped.  (ForeignServerDict._drop): New method to
   actually drop the servers.
 * tests/dbobject/test_foreign.py: New tests to verify order of
   multiple object creation/destruction.
Add support for modification of OPTIONS of FDW-related objects.

 * docs/foreign.rst: Document new helper class DbObjectWithOptions.
 * pyrseas/dbobject/foreign.py (DbObjectWithOptions): New helper
   class.  ({ForeignDataWrapper, ForeignServer, UserMapping,
   ForeignTable}): Derive from new helper class, add diff_map method
   (except for UserMapping) and change create method.
 * tests/dbobject/test_foreign.py: New tests to verify OPTIONS changes.
Changes to foreign tables should use ALTER FOREIGN TABLE.

 * pyrseas/dbobject/column.py (Column.drop): Use objtype instead of
   hard-coding 'TABLE'.
 * pyrseas/dbobject/foreign.py (DbObjectWithOptions.diff_map): Invoke
   super method.
 * pyrseas/dbobject/table.py (Table.diff_map): Use objtype instead of
   hard-coding 'TABLE'.
 * tests/dbobject/test_foreign.py: New test to verify changes.

Main changes by Ronan Dunklau, test by Joe Abbate.
Update release files for 0.5.0.
Fix dbconn.py exception handling under Python 3. Fixes #25.

  Author: Chris Mayo