Closed reedstrm closed 10 years ago
That table by itself doesn't appear to cause a problem, at least when I test against a previously empty PG 9.1 database.
What I find weird is that the last line in the traceback is reported as being line 822, but I see that line at https://github.com/perseas/Pyrseas/blob/master/pyrseas/dbobject/table.py#L819. Did you perhaps edit the file?
This is a 9.3 empty db. That is weird - the one I see in front me me after doing a reinstall says 819:
git diff
(dev)reedstrm@desert:/opt/dev/Pyrseas$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
$ git remote -v
origin https://github.com/perseas/Pyrseas.git (fetch)
origin https://github.com/perseas/Pyrseas.git (push)
Pyrseas$ dbtoyaml test
Traceback (most recent call last):
File "/opt/dev/bin/dbtoyaml", line 9, in <module>
load_entry_point('Pyrseas==0.7.1', 'console_scripts', 'dbtoyaml')()
File "/opt/dev/local/lib/python2.7/site-packages/Pyrseas-0.7.1-py2.7.egg/pyrseas/dbtoyaml.py", line 49, in main
dbmap = db.to_map()
File "/opt/dev/local/lib/python2.7/site-packages/Pyrseas-0.7.1-py2.7.egg/pyrseas/database.py", line 268, in to_map
self.from_catalog()
File "/opt/dev/local/lib/python2.7/site-packages/Pyrseas-0.7.1-py2.7.egg/pyrseas/database.py", line 178, in from_catalog
self._link_refs(self.db)
File "/opt/dev/local/lib/python2.7/site-packages/Pyrseas-0.7.1-py2.7.egg/pyrseas/database.py", line 138, in _link_refs
db.triggers)
File "/opt/dev/local/lib/python2.7/site-packages/Pyrseas-0.7.1-py2.7.egg/pyrseas/dbobject/table.py", line 819, in link_refs
table.owner_column = self[(sch, table.owner_table)]. \
KeyError: (u'public', 'tions')
ok. testing w/ another new db, but using template0 does not fail, so I've got something installed in template1 causing this.
Ah 'cause my example lied, I cut it from a pg_dump. The critical bit is having a serial column:
create table publications (id serial, doc text);
even against template0 is good enough to trigger it.
OK, reproduced. Will check what's wrong later.
thanks. Makes sense, that bit of code is linking up sequences owned by the table.
Last bit of debug - it's specific to tables that match public.public* with a serial column. A private.private* works, as does other.public*
Here's the code at fault: https://github.com/perseas/Pyrseas/blob/master/pyrseas/dbobject/table.py#L70-L75
Something's eating my publications table's name