-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problem dumping aggregate #175
Comments
seems related to #169 |
I'm pretty sure it's unrelated to #169. The problem with your aggregate is that it depends on an SFUNC that we don't retrieve because, shall we say, we don't find it to be "of interest" (although we should). If you run the query at Pyrseas/pyrseas/dbobject/function.py Line 126 in 42220a2
psql you'll see it returns no rows (it may return some rows in your db but not the tsvector_concat ). If you remove the "nspname != 'pg_catalog' AND " from the WHERE clause then it will show up, but so will 2500 other pg_catalog functions.
I thought that perhaps the work done by @dvarrazzo on dependency tracking would catch issues like this but apparently that's not the case. Whenever someone specializes (in the OO sense) on a |
The problem seems to me that
well, not so much of a problem, but an inconsistency: for instance relations are always referred as oid where they could be defined as
So when you read
I remember working in pyrseas that disambiguating objects in different schemas was already tricky, and disambiguating functions was even more because you can have the same func with same name and schema but different signature. I think the solution for aggregates is to use numeric oids (casting the
Can't remember if there is support in pyrseas to refer to functions or other objects by oid? Parsing nulls also sucks big time... Pyrseas/pyrseas/dbobject/function.py Line 389 in 42220a2
That's not even null, it's |
In this case this is not the problem, Pyrseas/pyrseas/dbobject/function.py Lines 577 to 598 in 42220a2
(see also how much it sucks needing to generate a signature to solve the depending functions whereas using the oid it would not be a concern...) |
Yup, I just noticed when poking at this in pdb that the schema assigned is wrong - |
Daniele, with all due respect but I think you're chasing the rabbit down the wrong hole. At the point where Ross gets the error, we're trying to find the function Re: the '-' in parsing regprocs (and other things) is because PG catalogs define most attributes as The problem with disambiguating schemas is due to a rather unfortunate initial design decision: doing a OIDs can't be used because we have to produce an external (YAML) dump and accept that back as input. See #119 for additional details. I hope we can eventually get rid of internal use of OIDs and rely solely on external object keys. |
Yes but the error is:
regardless of why is wrong, this looks wrong to me:
I would find more appropriate to define a lack of existence with a NULL instead of with InvalidOid. However this is an opinion and not material for this bug.
If you go down this road I suggest instead to drop everything from
I don't say to store the oids, I know it is not possible. This is only to create dependency edges in the graph path. It would be way easier if oids were used everywhere - still IMO and still not necessary to fix this bug. |
I'm not sure what looks wrong to you: something about the way
Special-casing |
|
The tests in tests/dbobject all pass, however the following have been marked xfail: test_type.py: BaseTypeToSql.test_drop_type test_operclass.py: ToSql.test_create_operclass_default test_trigger.py: ToSql.test_add_tsvector_trigger, test_change_tsvector_trigger The first two fail with an exception in Database.dep_sorted indicating a loop in the dependency graph. The other two fail because we don't retrieve info for pg_catalog objects such as 'tsvector_update_trigger' (see similar discussion in #175). The following functional tests currently fail: test_autodoc.py, test_autodoc_dir.py and test_pagila.py.
…176. This correction allows the removal of the mark.xfail from the tests in test_operclass and test_type. However, three other tests in the former had to be marked xfail because Pyrseas has virtually no info on PG system objects (e.g., types such as 'integer', functions such as 'ts_vector_concat' [see issue #175]).
@reedstrm Please take a look at https://pyrseas.wordpress.com/2018/09/12/the-future-of-pyrseas-revisited/ . Solving this issue is dependent on issue #185 and I have no estimate of when that will worked on. |
I have a custom aggregate for fulltext search vectors, built on top of tsvector_concat defiend as so:
Attempting to dump it w/
dbtoyaml
gives this traceback:This is tip-of-master code:
The text was updated successfully, but these errors were encountered: