fix different PG capabilities in schema
Related: https://pagure.io/koji/issue/3594
This commit is contained in:
parent
f7d9a96961
commit
c11056996b
2 changed files with 24 additions and 3 deletions
|
|
@ -2,6 +2,16 @@
|
||||||
-- from version 1.30 to 1.31
|
-- from version 1.30 to 1.31
|
||||||
|
|
||||||
BEGIN;
|
BEGIN;
|
||||||
-- index for default search method for rpms
|
-- index for default search method for rpms, PG11+ can benefit from new include method
|
||||||
CREATE INDEX rpminfo_filename ON rpminfo((name || '-' || version || '-' || release || '.' || arch || '.rpm')) INCLUDE (id);
|
DO $$
|
||||||
|
DECLARE version integer;
|
||||||
|
BEGIN
|
||||||
|
SELECT current_setting('server_version_num')::integer INTO version;
|
||||||
|
IF version >= 110000 THEN
|
||||||
|
EXECUTE 'CREATE INDEX rpminfo_filename ON rpminfo((name || ''-'' || version || ''-'' || release || ''.'' || arch || ''.rpm'')) INCLUDE (id);';
|
||||||
|
ELSE
|
||||||
|
EXECUTE 'CREATE INDEX rpminfo_filename ON rpminfo((name || ''-'' || version || ''-'' || release || ''.'' || arch || ''.rpm''));';
|
||||||
|
END IF;
|
||||||
|
END
|
||||||
|
$$;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
|
||||||
|
|
@ -734,7 +734,18 @@ CREATE TABLE rpminfo (
|
||||||
CONSTRAINT rpminfo_unique_nvra UNIQUE (name,version,release,arch,external_repo_id)
|
CONSTRAINT rpminfo_unique_nvra UNIQUE (name,version,release,arch,external_repo_id)
|
||||||
) WITHOUT OIDS;
|
) WITHOUT OIDS;
|
||||||
CREATE INDEX rpminfo_build ON rpminfo(build_id);
|
CREATE INDEX rpminfo_build ON rpminfo(build_id);
|
||||||
CREATE INDEX rpminfo_filename ON rpminfo((name || '-' || version || '-' || release || '.' || arch || '.rpm')) INCLUDE (id);
|
-- index for default search method for rpms, PG11+ can benefit from new include method
|
||||||
|
DO $$
|
||||||
|
DECLARE version integer;
|
||||||
|
BEGIN
|
||||||
|
SELECT current_setting('server_version_num')::integer INTO version;
|
||||||
|
IF version >= 110000 THEN
|
||||||
|
EXECUTE 'CREATE INDEX rpminfo_filename ON rpminfo((name || ''-'' || version || ''-'' || release || ''.'' || arch || ''.rpm'')) INCLUDE (id);';
|
||||||
|
ELSE
|
||||||
|
EXECUTE 'CREATE INDEX rpminfo_filename ON rpminfo((name || ''-'' || version || ''-'' || release || ''.'' || arch || ''.rpm''));';
|
||||||
|
END IF;
|
||||||
|
END
|
||||||
|
$$;
|
||||||
|
|
||||||
-- sighash is the checksum of the signature header
|
-- sighash is the checksum of the signature header
|
||||||
CREATE TABLE rpmsigs (
|
CREATE TABLE rpmsigs (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue