[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [GSoC] Prospective packages importer



Hi,

On Mon, Aug 24, 2015 at 4:01 PM, Ghislain Vaillant <ghisvail@gmail.com> wrote:
>
>>> I've sent a patch creating two tables - blends_unknown_packages and
>>> package_remark. I thought of making 'package' as primary key but I noticed
>>> blends_prospectivepackages does not do so. I have not made any column as
>>> primary key for now. Let me know what is to be done.
>>
>>
>> Hmmm, very good point!  I was wondering why we do not have a primary key
>> since this sounds very sensible.  So I checked and found:
>>
>>
>> udd=# select package, source, chlog_date, chlog_version, vcs_url, changed_by from blends_prospectivepackages where package like 'python-imageio' ;
>>      package     |     source     |           chlog_date            | chlog_version |                                 vcs_url                                 |                  changed_by
>> ----------------+----------------+---------------------------------+---------------+-------------------------------------------------------------------------+-----------------------------------------------
>>   python-imageio | imageio        | Sun, 16 Nov 2014 18:03:39 +0000 | 1.1-1         | git://anonscm.debian.org/git/debian-science/packages/imageio.git        | Ghislain Antony Vaillant <ghisvail@gmail.com>
>>   python-imageio | python-imageio | Thu, 23 Apr 2015 22:18:25 +0100 | 1.2-1         | git://anonscm.debian.org/git/debian-science/packages/python-imageio.git | Ghislain Antony Vaillant <ghisvail@gmail.com>
>> (2 Zeilen)
>>
>>
>
> Apologize for the duplicates. I forgot to do my homework and clean the previous one.
>
> I will delete the imageio.git / keep python-imageio.git.
>
> That's also a good reminder to finish that work at some point.
>
>

udd=# select package, count(*) from blends_prospectivepackages group by package having count(*) > 1;
     package     | count
-----------------+-------
 python-imageio  |     2
 python3-imageio |     2
(2 rows)

>> I wonder how this can happen since to my (obviously bad) memory the
>> importer tries to prevent duplicates.  I'd vote for a primary key (for
>> blends_prospectivepackages *and* blends_unknown_packages) and fixing the
>> importer to respect this.
>>
>> Otherwise we might run into trouble with the current queries.
>>

I have sent new patches that:

1. add primary key constraint to blends_prospectivepackages making "package" as primary key
2. create table blends_unknown_packages (primary key - package)
3. create table package_remark (primary key - package)

Also, as noted above python-imageio, python3-imageio are the only packages that violate the primary key constraint. If these packages are removed, then we'll not have any duplicates and because of the constraint there will be no duplicates in future.

So, should I modify the importer to again check for this constraint ? Or, will it suffice to remove these packages and add constraint primary key (package) to blends_prospectivepackages ?

--
Regards,
Akshita Jha

Reply to: