Skip to content

Commit

Permalink
Release 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rjuju committed Apr 28, 2024
1 parent 6e1a46d commit 97026c0
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 1 deletion.
14 changes: 14 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,20 @@
Changelog
=========

2024-04-28 version 1.4.1:
-------------------------

**Bug fixes**:

- Fix hypothetical index names when its Oid is more than 1 billion (Julien
Rouhaud, thanks to github user sylph520 for the report)
- Fix hypothetical index deparsing when attributes need quoting (Julien
Rouhaud, thanks to Daniel Lang for the report)

**Miscellaneous**:

- Add support for PostgreSQL 17 (Georgy Shelkovy, Julien Rouhaud)

2023-05-27 version 1.4.0:
-------------------------

Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
@@ -1,3 +1,9 @@
hypopg (1.4.1-1) unstable; urgency=medium

* New upstream version.

-- Julien Rouhaud <rjuju123@gmail.com> Sun, 28 Apr 2024 09:14:18 +0800

hypopg (1.4.0-2) unstable; urgency=medium

* Upload for PostgreSQL 16.
Expand Down
7 changes: 7 additions & 0 deletions hypopg--1.4.0--1.4.1.sql
@@ -0,0 +1,7 @@
-- This program is open source, licensed under the PostgreSQL License.
-- For license terms, see the LICENSE file.
--
-- Copyright (C) 2015-2024: Julien Rouhaud

-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "ALTER EXTENSION hypopg" to load this file. \quit
105 changes: 105 additions & 0 deletions hypopg--1.4.1.sql
@@ -0,0 +1,105 @@
-- This program is open source, licensed under the PostgreSQL License.
-- For license terms, see the LICENSE file.
--
-- Copyright (C) 2015-2024: Julien Rouhaud

-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION hypopg" to load this file. \quit

SET LOCAL client_encoding = 'UTF8';

CREATE FUNCTION hypopg_reset_index()
RETURNS void
LANGUAGE C VOLATILE COST 100
AS '$libdir/hypopg', 'hypopg_reset_index';

CREATE FUNCTION hypopg_reset()
RETURNS void
LANGUAGE C VOLATILE COST 100
AS '$libdir/hypopg', 'hypopg_reset';

CREATE FUNCTION
hypopg_create_index(IN sql_order text, OUT indexrelid oid, OUT indexname text)
RETURNS SETOF record
LANGUAGE C STRICT VOLATILE COST 100
AS '$libdir/hypopg', 'hypopg_create_index';

CREATE FUNCTION
hypopg_drop_index(IN indexid oid)
RETURNS bool
LANGUAGE C STRICT VOLATILE COST 100
AS '$libdir/hypopg', 'hypopg_drop_index';

CREATE FUNCTION hypopg(OUT indexname text, OUT indexrelid oid,
OUT indrelid oid, OUT innatts integer,
OUT indisunique boolean, OUT indkey int2vector,
OUT indcollation oidvector, OUT indclass oidvector,
OUT indoption oidvector, OUT indexprs pg_node_tree,
OUT indpred pg_node_tree, OUT amid oid)
RETURNS SETOF record
LANGUAGE c COST 100
AS '$libdir/hypopg', 'hypopg';

CREATE VIEW hypopg_list_indexes
AS
SELECT h.indexrelid, h.indexname AS index_name, n.nspname AS schema_name,
coalesce(c.relname, '<dropped>') AS table_name, am.amname AS am_name
FROM hypopg() h
LEFT JOIN pg_catalog.pg_class c ON c.oid = h.indrelid
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
LEFT JOIN pg_catalog.pg_am am ON am.oid = h.amid;

CREATE FUNCTION
hypopg_relation_size(IN indexid oid)
RETURNS bigint
LANGUAGE C STRICT VOLATILE COST 100
AS '$libdir/hypopg', 'hypopg_relation_size';

CREATE FUNCTION
hypopg_get_indexdef(IN indexid oid)
RETURNS text
LANGUAGE C STRICT VOLATILE COST 100
AS '$libdir/hypopg', 'hypopg_get_indexdef';

CREATE FUNCTION
hypopg_hide_index(IN indexid oid)
RETURNS bool
LANGUAGE C STRICT VOLATILE COST 100
AS '$libdir/hypopg', 'hypopg_hide_index';

CREATE FUNCTION
hypopg_unhide_index(IN indexid oid)
RETURNS bool
LANGUAGE C STRICT VOLATILE COST 100
AS '$libdir/hypopg', 'hypopg_unhide_index';

CREATE FUNCTION
hypopg_unhide_all_indexes()
RETURNS void
LANGUAGE C VOLATILE COST 100
AS '$libdir/hypopg', 'hypopg_unhide_all_indexes';

CREATE FUNCTION hypopg_hidden_indexes()
RETURNS TABLE (indexid oid)
LANGUAGE C STRICT VOLATILE
AS '$libdir/hypopg', 'hypopg_hidden_indexes';

CREATE VIEW hypopg_hidden_indexes
AS
SELECT h.indexid AS indexrelid,
i.relname AS index_name,
n.nspname AS schema_name,
t.relname AS table_name,
m.amname AS am_name,
false AS is_hypo
FROM hypopg_hidden_indexes() h
JOIN pg_index x ON x.indexrelid = h.indexid
JOIN pg_class i ON i.oid = h.indexid
JOIN pg_namespace n ON n.oid = i.relnamespace
JOIN pg_class t ON t.oid = x.indrelid
JOIN pg_am m ON m.oid = i.relam
UNION ALL
SELECT hl.*, true AS is_hypo
FROM hypopg_hidden_indexes() hi
JOIN hypopg_list_indexes hl on hl.indexrelid = hi.indexid
ORDER BY index_name;
2 changes: 1 addition & 1 deletion hypopg.control
@@ -1,6 +1,6 @@
# hypopg extension
comment = 'Hypothetical indexes for PostgreSQL'
default_version = '1.4.0'
default_version = '1.4.1'
module_pathname = '$libdir/hypopg'
relocatable = true

0 comments on commit 97026c0

Please sign in to comment.