Re: couple bugs with schema
Jacob Smullyan <[email protected]> Fri, 13 Jan 2006 11:48:10 -0500
| Newsgroups | gmane.comp.web.skunkweb |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Jan 13, 2006 at 08:49:11AM -0700, Jonathan Ellis wrote: > That's probably the right thing to do. Cleaner would be to add "AND > a.attnum > 0" to the query itself, though, which is what the other > query on pg_attribute does right now. That only deals with the case where the first element of indkey is negative; but sometimes only an element farther down in the array is negative (browse through "select indkey from pg_catalog.indkey" -- excellent summer reading). So you'd need something like "AND 0 < ANY(indkey)", except that indkey is an int2vector and doesn't support the ANY operator; there is probably a way to do it in sql, but I don't know what it is. My patch just stripped out the negative ids from the constraints, only tossing out the constraint entirely if the constraint didn't contain any nonnegative values. That may well be wrong, and result in constraints being misreported; maybe the whole constraint should be skipped in there is a negative id in it (which would be equivalent to the proposed but unworkable SQL above). It would be better to find fewer constraints than find ones that don't actually exist. I don't have time to research this today, but if no one else knows how these catalogs actually work in regard to indices and system columns I'll look into it soon. j -- Jacob Smullyan
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFDx9nKuqamFyFXXLIRAs7yAJ9BTfi6Orwfw2n74/vPmP6T4+BsQgCfQBAH 41xj0esJxVodS9YbYvw5xXM= =uuTA -----END PGP SIGNATURE-----