-
-
Save jeff/338326337eed82f1a60cde1f388b2123 to your computer and use it in GitHub Desktop.
ruling out a copy visibility issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH base_vis_mask AS ( | |
SELECT c_attrs | |
FROM asset.patron_default_visibility_mask() | |
), | |
circ_lib_mask AS ( | |
SELECT search.calculate_visibility_attribute_test('circ_lib', ARRAY_AGG(aoud.id)) AS mask | |
FROM actor.org_unit_descendants(1) AS aoud | |
), | |
visible_copies AS ( | |
SELECT target_copy | |
FROM asset.copy_vis_attr_cache AS acvac, | |
base_vis_mask, circ_lib_mask | |
WHERE | |
acvac.vis_attr_vector @@ (base_vis_mask.c_attrs || '&' || circ_lib_mask.mask)::query_int | |
) select * from visible_copies where target_copy in (select id from asset.copy where deleted = false and call_number in (select id from asset.call_number where deleted = false and record = 693452)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment