Menu

#93 Delete defunct pseudonyms

closed-fixed
5
2009-08-16
2009-08-08
Ahasuerus
No

The database has a table recording pseudonym relationships between author records. There are entries in that table that have pseudonyms for a no-longer-existing author records. The rendering of the search results scans this table to populate the "Pseudonym?" column and does not verify that the parent record exists (it shouldn't have to). Other parts of author-related display most likely work directly with the author records (i.e., "get me the author for which Hilbert Schenck is a pseudonym") and consider finding no parent to mean it's not a pseudonym. Looks like there are 62 such problems in the Aug 1 back-up.

select count(*) from pseudonyms where not exists
(select * from authors where authors.author_id = pseudonyms.author_id);

these can be cleaned up:

delete from pseudonyms where not exists
(select * from authors where authors.author_id = pseudonyms.author_id);

Discussion

  • Ahasuerus

    Ahasuerus - 2009-08-10

    Script /delete_defunct_pseudonyms.sql revision 1.1 committed to the repository.

     
  • Ahasuerus

    Ahasuerus - 2009-08-10
    • summary: Delete invalid pseudonyms --> Delete defunct pseudonyms
     
  • Ahasuerus

    Ahasuerus - 2009-08-16
    • status: open --> closed-fixed
     
  • Ahasuerus

    Ahasuerus - 2009-08-16

    Script deployed and run in r2009-17.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB