On Mon, 2007-12-17 at 09:45 -0800, msoulier wrote:
> I'm trying to write db initialization code for an existing db
> framework on a product that I work on. To do this I'm "asking" django
> to show SQL that it would use to create its db, so I can copy it into
> the initialization code.
> 
> I can't though, as I haven't created the db yet, and for some reason
> it requires access to the db, even though it's not actually performing
> any operations on the db.
> 
> [EMAIL PROTECTED] servermanager]# python manage.py sql main
> BEGIN;
> Traceback (most recent call last):
>   File "manage.py", line 12, in ?
>     execute_manager(settings)
>   File "/var/tmp/django-0.96-root/usr/lib/python2.3/site-packages/
> django/core/management.py", line 1672, in execute_manager
>   File "/var/tmp/django-0.96-root/usr/lib/python2.3/site-packages/
> django/core/management.py", line 1632, in execute_from_command_line
>   File "/var/tmp/django-0.96-root/usr/lib/python2.3/site-packages/
> django/core/management.py", line 123, in get_sql_create
>   File "/var/tmp/django-0.96-root/usr/lib/python2.3/site-packages/
> django/core/management.py", line 68, in _get_table_list
>   File "/var/tmp/django-0.96-root/usr/lib/python2.3/site-packages/
> django/db/backends/postgresql_psycopg2/base.py", line 48, in cursor
> psycopg2.OperationalError: FATAL:  Password authentication failed for
> user "smeserver"
> 
> Seems like a bit of a chicken and egg problem. I'll create the db and
> user now, but I don't see why it should be required when it's not
> being used by the command. I suppose it might not be fixable, as it
> may be in the psycopg2 module.

Unfortunate, but not really worth worrying about. This is such an
edge-case that this isn't really worth putting in any significant extra
code to work around. Just create the database and you won't have the
problem.

It's so rare as to be effectively non-existent that you'll be wanting to
view the SQL and never, ever connect to the database.

Malcolm

-- 
Tolkien is hobbit-forming. 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to