On Sat, Apr 18, 2020 at 06:07:41PM +0200, Thomas L. wrote: > On Sat, 18 Apr 2020 15:08:59 +0200 > Marc Espie <[email protected]> wrote: > > It's very likely to miss a canonical at least. > > > > Specifically, _Ports.FullPkgPath is not guaranteed to match every > > _Paths.Id > > > > the _Ports table get canonicalized to save space and avoid duplicates. > > I saw the Canonical field in _Paths and wondered about its use, but I > am still unclear after your explanation. _Ports.FullPkgPath has a > foreign key constraint on _Paths.Id and _Paths.PkgPath has a constraint > on _Paths.Id, too. Constraint enforcement is disabled, but > SELECT pkgstem FROM _ports > LEFT JOIN _paths ON _paths.id = _ports.fullpkgpath > LEFT JOIN _paths AS _pkgpaths ON _pkgpaths.id = _paths.pkgpath > WHERE _pkgpaths.fullpkgpath IS NULL; > shows there are no violations. >
all _Ports.fullpkgpath are valid _paths.id, but the reverse is not true! _Ports has guaranteed lines for all canonical values.
