Commit graph

150 commits

Author SHA1 Message Date
Yugo Nagata
1c4408199c Fix error codes for invalid input to create_immv 2022-06-22 17:59:20 +09:00
Yugo Nagata
279b14049e
Update README.md
Add description about how to disable or enable IVM
2022-06-22 16:41:33 +09:00
Yugo Nagata
384347fdeb
Update README for pg_ivm 1.1
Add description about aggregates, TRUNCATE, and refresh_immv.
2022-06-22 16:09:04 +09:00
Yugo Nagata
53c9509163 Fix check for aggregate functions to work with PostgreSQL 13
In PostgreSQL 14 or later, OIDs of aggregate functions are
described in fmrgoids.h, but that in PostgreSQL 13 doesn't
contain aggregate function OIDs. Therefore, we get the OID
by passing the function name and arg type to to_regprocedure().
2022-06-21 23:08:54 +09:00
Yugo Nagata
d99aeb848e Allow TRUNCATE on base tables (#144)
When a base table is truncated, the view content will be empty if the
view definition query does not contain an aggregate without a GROUP clause.
Therefore, such views can be truncated.

Aggregate views without a GROUP clause always have one row. Therefore,
if a base table is truncated, the view will not be empty and will contain
a row with NULL value (or 0 for count()). So, in this case, we refresh the
view instead of truncating it.
2022-06-21 21:27:21 +09:00
Yugo Nagata
57c8bac1a0 Add aggregates support
Built-in count, sum, avg are supported. We have not supported min/max
yet, but will support in future.

When an IMMV with any aggregates are defined, additional columns
are created for each aggregate function. Although such columns are
"hidden" in pgsql-ivm version, they are always visible for users
in the extension version.
2022-06-21 20:50:45 +09:00
Yugo Nagata
1e80a34a86 Move the new function and catalog attributes to a update script 2022-06-16 10:07:54 +09:00
thoshiai
51a944b388 Add refresh_immv() function
refresh_immv(immv_name, with_data) is a function to refresh IMMV like
 REFRESH MATERIALIZED VIEW command. It has two argument.
immv_name is incrementally maintainable materialized view's name, and
with_data is an option that is corresponding to the WITH [NO] DATA option.
When with_data is set false, the IMMV gets unpopulated.

One of differences between IMMVs unpopulated by this function and
normal materialized views unpopulated by REFRESH ... WITH NO DATA
is that such IMMVs can be referenced by SELECT but return no rows,
while unpopulated materialized views are not scanable.

The behaviour may be changed in future to raise an error when unpopulated
an IMMV is scanned.
2022-06-16 03:06:47 +09:00
Yugo Nagata
7ab42004d2
Merge pull request #12 from sraoss/11-pg_ivm-test-fails-on-postgresql-15-beta1
Fix the test to grant create permissions on the public schema
2022-06-13 13:25:49 +09:00
Yugo Nagata
a37de7aa7a
Merge pull request #13 from tatsuo-ishii/README_fix
Mention that pg_ivm is compatible with PostgreSQL 13 in addition to 
PostgreSQL 14.
2022-06-13 09:35:48 +09:00
Tatsuo Ishii
7868c7b923 Mention that pg_ivm is compatible with PostgreSQL 13 in addition to PostgreSQL 14. 2022-06-11 18:57:14 +09:00
Yugo Nagata
a75443f8ea Fix the test to grant create permissions on the public schema
As of PG15, PUBLIC CREATE was revoked from public schema, so
we have to grant it in contrib_regression database.
2022-06-03 15:53:41 +09:00
Yugo Nagata
9719ed644d
Merge pull request #10 from tatsuo-ishii/rel13
Allow to build pg_ivm on PostgreSQL 13.
2022-06-02 14:46:59 +09:00
Yugo Nagata
42a5bcd24e Fix pg_ivm.spec take2 2022-06-02 12:04:55 +09:00
Yugo Nagata
575e8ff0ac Fix spec file 2022-06-02 11:27:41 +09:00
Tatsuo Ishii
612b59694e Allow to build pg_ivm on PostgreSQL 13. 2022-05-17 21:32:04 +09:00
Yugo Nagata
ad0d36220f
Update README.md 2022-05-12 16:25:15 +09:00
Yugo Nagata
0a99573ff3
Update README.md 2022-05-12 16:22:13 +09:00
Yugo Nagata
5776ea3aa6
Update README.md 2022-05-12 16:15:46 +09:00
Yugo Nagata
0c44342ba8
Update README.md 2022-05-12 16:14:36 +09:00
Yugo Nagata
f4579fa3fc
Merge pull request #8 from sraoss/header
Fix a header guard macro. Reported by Issue #6.
2022-05-03 03:24:39 +09:00
Yugo Nagata
0b2f41d82a Fix a header gurad macro 2022-05-03 03:19:58 +09:00
Yugo Nagata
489af72ed4 Fix pg_ivm.spec 2022-05-03 03:16:29 +09:00
Yugo Nagata
c9730b8907 Merge branch 'main' of https://github.com/sraoss/pg_ivm into main 2022-05-03 02:37:39 +09:00
Yugo Nagata
5b6a0bc6d2 Add pg_ivm.spec 2022-05-03 02:37:24 +09:00
Yugo Nagata
039f15c783
Merge pull request #7 from fjf2002/patch-1
Update README.md
2022-05-02 18:01:31 +09:00
fjf2002
8374ae71b5
Update README.md
Typo fixed
2022-05-02 11:00:18 +02:00
Yugo Nagata
f2d43bb923 Fix to delete the pg_ivm_immv entry when an IMMV is dropped 2022-04-28 19:47:30 +09:00
Yugo Nagata
f68e04524b Fix to parse relname and column in create_immv arguments
It enables earlier checks for invalid inputs.
2022-04-28 18:59:48 +09:00
Yugo Nagata
ab1bc09d8e
Split files for ease of following the changes of the core code
createas.c and matview.c contain corresponding functions that are
defined in the same name files in the core version. pg_ivm.c contains
user interface functions and callback functions.

The file names are identical to those in the core code  ( in pgsql-ivm 
repository) and  some codes are copied from it so that we can easily 
compare the code between the extension and the core. That is because
we would like to apply features in this extension to the core as a new 
feature in future. Also, we plan to adopt the core code change to the 
extension to prevent the difference from being too far. However, 
considering modularity or code-readability, it is possible that we may change this policy in future.

In passing, Makefile is also fixed and we don't need to use
USE_PGXS now.
2022-04-27 23:15:58 +09:00
Yugo Nagata
2255a73ff1
Update README.md 2022-04-27 15:08:01 +09:00
Yugo Nagata
eed6271128 Split files to make it easier to follow the core code 2022-04-27 14:45:47 +09:00
Yugo Nagata
f586a03716
Update README.md 2022-04-15 09:44:31 +09:00
Yugo Nagata
34c44eb4b1
Update README.md 2022-04-14 16:58:25 +09:00
Yugo Nagata
0a5f018fb9
Update README.md 2022-04-13 14:40:36 +09:00
Yugo Nagata
79693823d7
Merge pull request #3 from marcocitus/patch-1
Make create_immv STRICT
2022-04-08 18:44:23 +09:00
Marco Slot
61c93dc2dc
Make create_immv STRICT
This currently crashes the server: `SELECT create_immv(NULL, 'SELECT * FROM test');` . Marking the function STRICT will avoid calling it with NULL arguments.

Alternative would be check for NULLs in create_immv.
2022-04-01 15:14:15 +02:00
Yugo Nagata
9f02dc84dd
Merge pull request #2 from hanefi/patch-1
Fix simple typos in README
2022-04-01 22:01:46 +09:00
Hanefi Onaldi
dc13661b13
Fix simple typos in README
Incremnetal -> Incremental
Installaion -> Installation
2022-04-01 15:08:36 +03:00
Yugo Nagata
5609f1a757 Merge branch 'main' of https://github.com/sraoss/pg_ivm into main 2022-04-01 10:58:17 +09:00
Yugo Nagata
65fc7b3b69 Fix regression test's expected results
Forgotten to commit
2022-04-01 10:56:57 +09:00
Yugo Nagata
b1cb960b45
Merge pull request #1 from tatsuo-ishii/main
Fix typo.
2022-04-01 10:31:33 +09:00
Tatsuo Ishii
5cdd35c7ab
Merge branch 'sraoss:main' into main 2022-04-01 10:28:40 +09:00
Yugo Nagata
94fb07b173
Update README.md 2022-04-01 10:27:45 +09:00
Yugo Nagata
bf467c2e9b Add copyright 2022-04-01 10:27:00 +09:00
Tatsuo Ishii
2c960c7b27 Fix typo in an example sql. 2022-04-01 10:26:19 +09:00
Yugo Nagata
fc939ba681 Update README.md 2022-04-01 01:08:28 +09:00
Yugo Nagata
1bce646d21 Initial release of pg_ivm 1.0 2022-04-01 01:08:28 +09:00
Yugo Nagata
02ab740304 Add LICENSE 2022-03-29 19:19:36 +09:00
Yugo Nagata
64eaed8831
Create README.md 2022-03-29 19:08:46 +09:00