[Spacewalk-list] Spacewalk 2.10 Released!

Eckert, Doug Doug.Eckert at dowjones.com
Thu Mar 19 12:28:56 UTC 2020


I tried, but it wouldn't let me remove the record due to foreign key
reference, so I updated the existing record instead with the value it
would've used from the 'insert' command:

rhnschema=# update rhnPackageKey set
provider_id=lookup_package_provider('CentOS') where
key_id='05b555b38483c65d';
UPDATE 1
rhnschema=# select * from rhnPackageKey where key_id='05b555b38483c65d';
 id  |      key_id      | key_type_id | provider_id |            created
         |           modified
-----+------------------+-------------+-------------+-------------------------------+-------------------------------
 157 | 05b555b38483c65d |         100 |         102 | 2020-02-21
09:06:55.782751-05 | 2020-03-19 08:26:56.268446-04
(1 row)

On Thu, Mar 19, 2020 at 8:21 AM Eckert, Doug <Doug.Eckert at dowjones.com>
wrote:

> I asked because on my server, the matching key_id has an empty
> 'provider_id' field
>
> rhnschema=# insert into rhnPackageKey (id, key_id, key_type_id,
> provider_id) values
> rhnschema-# (sequence_nextval('rhn_pkey_id_seq'), '05b555b38483c65d',
> lookup_package_key_type('gpg'), lookup_package_provider('CentOS'));
> ERROR:  duplicate key value violates unique constraint "rhn_pkey_keyid_uq"
> DETAIL:  Key (key_id)=(05b555b38483c65d) already exists.
>
> rhnschema=# select * from rhnPackageKey where key_id='05b555b38483c65d';
>  id  |      key_id      | key_type_id | provider_id |            created
>          |           modified
>
> -----+------------------+-------------+-------------+-------------------------------+-------------------------------
>  157 | 05b555b38483c65d |         100 |             | 2020-02-21
> 09:06:55.782751-05 | 2020-02-21 09:06:55.782751-05
> (1 row)
>
> Actually, there are 3 rows (out of 160) with a NULL provider_id.
>
> 156 | 49fc0fd89bd837ba |         100 |             | 2020-02-19
> 02:06:37.884325-05 | 2020-02-19 02:06:37.884325-05
> 157 | 05b555b38483c65d |         100 |             | 2020-02-21
> 09:06:55.782751-05 | 2020-02-21 09:06:55.782751-05
> 158 | 21ea45ab2f86d6a1 |         100 |             | 2020-02-21
> 10:53:24.558639-05 | 2020-02-21 10:53:24.558639-05
>
> Wondering if it would be wiser to remove the record
>
> delete from  rhnPackageKey  where key_id='05b555b38483c65d';
>
> Then re-insert it with the same id (157 in my case):
>
> insert into rhnPackageKey (id, key_id, key_type_id, provider_id) values
> (157, '05b555b38483c65d', lookup_package_key_type('gpg'),
> lookup_package_provider('CentOS'));
>
>
>
>
> On Thu, Mar 19, 2020 at 8:14 AM Ree, Jan-Albert van <J.A.v.Ree at marin.nl>
> wrote:
>
>> ​I skipped nothing but executed all queries, continuing on errors with
>> the next one and assumed that if there was an existing record it would be
>> fine already...
>>
>> Maybe not the best way, but it worked.
>>
>> --
>>
>> Jan-Albert
>>
>>
>>
>> Jan-Albert van Ree | HPC Specialist | Digital Services
>> MARIN | T +31 317 49 35 48 | J.A.v.Ree at marin.nl | www.marin.nl
>>
>> [image: LinkedIn] <https://www.linkedin.com/company/marin> [image:
>> YouTube] <http://www.youtube.com/marinmultimedia> [image: Twitter]
>> <https://twitter.com/MARIN_nieuws> [image: Facebook]
>> <https://www.facebook.com/marin.wageningen>
>> MARIN news: Courses Hydrodynamics  Floating Offshore Structures & Ship
>> design
>> <https://www.marin.nl/courses-hydrodynamics-floating-offshore-structures-and-ship-design>
>>
>> ------------------------------
>> *From:* spacewalk-list-bounces at redhat.com <
>> spacewalk-list-bounces at redhat.com> on behalf of Eckert, Doug <
>> Doug.Eckert at dowjones.com>
>> *Sent:* Thursday, March 19, 2020 13:08
>> *To:* spacewalk-list at redhat.com
>> *Subject:* Re: [Spacewalk-list] Spacewalk 2.10 Released!
>>
>> Did you skip the one with the duplicate key constraint error, or did you
>> remove the existing record with the matching key and re-insert?
>>
>> _______________________________________________
>> Spacewalk-list mailing list
>> Spacewalk-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/spacewalk-list
>
>
>
> --
> Doug Eckert
> LEAD ENGINEER, COMPUTE
> [image: NewsTech] <http://www.newscorp.com/>
> M: +1.732.666.3681 <+1+555+555+5555>    O: +1.609.520.4993
> <+1+555+555+5555>
> E: Doug.Eckert at DowJones.com <Cbergstresser at newscorp.com>
> A: PO Box 300, Princeton, NJ 08543
>


-- 
Doug Eckert
LEAD ENGINEER, COMPUTE
[image: NewsTech] <http://www.newscorp.com/>
M: +1.732.666.3681 <+1+555+555+5555>    O: +1.609.520.4993 <+1+555+555+5555>
E: Doug.Eckert at DowJones.com <Cbergstresser at newscorp.com>
A: PO Box 300, Princeton, NJ 08543
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20200319/1fba1f84/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image4b6f26.PNG
Type: image/png
Size: 293 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20200319/1fba1f84/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image163228.PNG
Type: image/png
Size: 331 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20200319/1fba1f84/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: imagedb8d5e.PNG
Type: image/png
Size: 333 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20200319/1fba1f84/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image00558a.PNG
Type: image/png
Size: 253 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20200319/1fba1f84/attachment-0003.png>


More information about the Spacewalk-list mailing list