Changeset 6238
- Timestamp:
- 09/14/07 17:40:13 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/gis/django/contrib/gis/db/backend/postgis/creation.py
r6026 r6238 29 29 # Constructing the necessary SQL to create the database (the DATABASE_USER 30 30 # must possess the privileges to create a database) 31 create_sql = 'CREATE DATABASE %s OWNER %s' % (connection.ops.quote_name(db_name), 32 settings.DATABASE_USER) 31 create_sql = 'CREATE DATABASE %s' % connection.ops.quote_name(db_name) 32 if settings.DATABASE_USER: 33 create_sql += ' OWNER %s' % settings.DATABASE_USER 34 33 35 cursor = connection.cursor() 34 36 _set_autocommit(connection) … … 134 136 "Obtains the command-line PostgreSQL connection options for shell commands." 135 137 # The db_name parameter is optional 138 options = '' 136 139 if db_name: 137 options = '-d %s -U %s ' % (db_name, settings.DATABASE_USER)138 else:139 options = '-U %s ' % settings.DATABASE_USER140 options += '-d %s ' % db_name 141 if settings.DATABASE_USER: 142 options += '-U %s ' % settings.DATABASE_USER 140 143 if settings.DATABASE_HOST: 141 144 options += '-h %s ' % settings.DATABASE_HOST
