Well, I fixed it.  Downloaded the latest version of pgAdmin.  Think
I'll probably throw it away & buy Navicat for my home office ASAP
however.

My old beta of pgAdmin III (the only one that would work w/SSL
tunneling) apparently *changed the name of the table* when I added the
field-- from artists_format to artists_formats.   User error a
possibility?  Sure, but I really can't figure out how that could've
easily happened!

Deleted the blank artists_format database that Django syncdb
generated, renamed the newly-named artists_formats (happily containing
all of its old data) to artist_format, & all is well.

So-- I like Navicat, anyone have any other favorite postgres admin
software that doesn't suck?

On May 25, 6:59 pm, Jason <elgrandchig...@gmail.com> wrote:
> Hey folks-- hope someone can possibly provide some insight here.
>
> I needed to add a field to a model. Django (0.96)/mod_python (3.3.1)/
> Python (2.5).  Not sure which version of Postgres we're running.
>
> So I added the field to the model.  Ran manage.py sqlall & got the
> (very simple) SQL to add the field.  Added the field to postgres using
> pgAdmin III 1.8.4.  Restarted the server.
>
> Django seemed to think the entire table had been dropped.  I ran
> manage.py syncdb & it created the table (artists_format).  However,
> the table is still in place, w/it's original data, according to
> pgAdmin III.
>
> It's showing up as completely empty of data in the Django admin
> interface.  Any attempt to readd the data (which is showing up as
> present & accounted for in pgAdmin III) results in:
>
> ProgrammingError at /admin/artists/format/add/
> currval of sequence "artists_format_id_seq" is not yet defined in this
> session
>
> Don't know if that's because Django's trying to add it as ID #1, which
> is already there according to pgAdmin III, or for some other hellish
> reason.
>
> Since the table artists_format only has 5 rows, I thought of trying to
> delete them via pgAdmin III so I could possibly re-add them via the
> Django admin.  No dice, they're necessary foreign keys from the table
> artists_albums_formats.  And I really don't want to lose that data
> (which links a few hundred albums to their proper formats).
>
> So what's the magic wand I wave when Django & Postgres go horribly out
> of sync like this?  I've done this procedure (adding a field to
> postgres & the model manually) dozens of times before & never had
> anything this horrific happen.  Help?
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to