Closed lyupan closed 9 months ago
could you also test upgrading to this version works and share the results?
could you also test upgrading to this version works and share the results?
Yes, tested locally. See results below. (This PR only changes the API to allow extra type options, it doesn't change the type storage/alignment if already defined)
Create pg_tle with old version library and version
postgres=# create extension pg_tle;
CREATE EXTENSION
postgres=# \dx
List of installed extensions
Name | Version | Schema | Description
---------+---------+------------+--------------------------------------------
pg_tle | 1.3.4 | pgtle | Trusted Language Extensions for PostgreSQL
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
(2 rows)
Create custom types and data
...
-- Variable-length
postgres=# SELECT pgtle.create_base_type('public', 'test_citext', 'test_citext_in(text)'::regprocedure, 'test_citext_out(bytea)'::regprocedure, -1);
create_base_type
------------------
(1 row)
11,22 (1 row)
SELECT INSERT UPDATE DELETE (4 rows)
3. Install the new extension library (1.4.0), restart postgres and upgrade
postgres=# ALTER EXTENSION pg_tle UPDATE;
ALTER EXTENSION
postgres=# \dx
List of installed extensions
Name | Version | Schema | Description
---------+---------+------------+--------------------------------------------
pg_tle | 1.4.0 | pgtle | Trusted Language Extensions for PostgreSQL
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
(2 rows)
4. Check the old types (tables) can still read/write
SELECT INSERT UPDATE DELETE (4 rows)
11,22 (1 row)
SELECT INSERT UPDATE DELETE (4 rows)
11,22 (1 row)
Thank you all for the review!
Issue #263.
In the previous version, we used default int4 alignment and plain storage (non-TOASTable). The data will always be stored in-line and not compressed. An error will be reported if the value exceeds the limit:
ERROR: row is too big: size xxx, maximum size xxx
With this change, users can customize the alignment and storage strategies. Compression or out-of-line storage can be used depending on the storage strategy (https://www.postgresql.org/docs/current/storage-toast.html).
The default alignment is int4 while the default storage is plain, compatible with previous versions.
A new version 1.3.5 is created along with this change.