...
Code Block | ||
---|---|---|
| ||
do
$$
declare
ind integer;
suffix text;
begin
for ind in 0 .. 999
loop
suffix = lpad(ind::text, 3, '0');
execute 'create table marc_indexers_' || suffix || ' partition of marc_indexers for values in ('''|| suffix ||''');';
end loop;
create table marc_indexers_cat partition of marc_indexers for values in ('cat');
create table marc_indexers_own partition of marc_indexers for values in ('own');
create table marc_indexers_lkr partition of marc_indexers for values in ('lkr');
end;
$$; |
...
The main concern here is that apart from standard field numbers and leader some libraries can use their own identifiers as field_no as in the example above. So there must be a solution to handle such cases.
Leader table
marc_indexers_leader |
---|
p_00_04 varchar(5) |
p_05 varchar(1) |
p_06 varchar(1) |
p_07 varchar(1) |
p_08 varchar(1) |
p_09 varchar(1) |
p_10 varchar(1) |
p_11 varchar(1) |
p_12_16 varchar(5) |
p_17 varchar(1) |
p_18 varchar(1) |
p_19 varchar(1) |
p_20 varchar(1) |
p_21 varchar(1) |
p_22 varchar(1) |
marc_id uuid |
Create table SQL statement
...