Re: [PATCH] src/test/modules/dummy_index -- way to test reloptions from inside of access method

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Dent John <denty(at)qqdd(dot)eu>
Cc: Nikolay Shaplov <dhyan(at)nataraj(dot)su>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: [PATCH] src/test/modules/dummy_index -- way to test reloptions from inside of access method
Date: 2019-08-01 23:12:35
Message-ID: CA+hUKG+7RWOvnvZ1H+e2iUfkXNA17RYO1upoGZm8Tsaet7HbDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 27, 2019 at 10:17 AM Dent John <denty(at)qqdd(dot)eu> wrote:
> > On 3 Apr 2019, at 20:54, Nikolay Shaplov <dhyan(at)nataraj(dot)su> wrote:
> > В письме от вторник, 19 марта 2019 г. 16:09:13 MSK пользователь Michael
> > Paquier написал:
> >
> >> Thanks for doing the effort to split that stuff. This looks like an
> >> interesting base template for anybody willing to look after some
> >> basics with index AMs, like what's done for FDWs with blackhole_fdw.
> > I am not sure it is good template. Most methods are empty, and does not show
> > any example of how it should work.
>
> [review]

Hi Nikolay,

While moving this to the September CF, I noticed this failure:

test reloptions ... FAILED 32 ms

--- /home/travis/build/postgresql-cfbot/postgresql/src/test/modules/dummy_index_am/expected/reloptions.out
2019-08-01 08:06:16.580197980 +0000
+++ /home/travis/build/postgresql-cfbot/postgresql/src/test/modules/dummy_index_am/results/reloptions.out
2019-08-01 08:11:57.817493999 +0000
@@ -13,12 +13,14 @@
CREATE INDEX test_idx ON tst USING dummy_index_am (i) WITH (int_option = 5);
WARNING: int_option = 5
ALTER INDEX test_idx SET (int_option = 3);
+ERROR: unrecognized lock mode: 2139062143
INSERT INTO tst VALUES(1);
-WARNING: int_option = 3
+WARNING: int_option = 5
ALTER INDEX test_idx SET (bool_option = false);
ALTER INDEX test_idx RESET (int_option);
+ERROR: unrecognized lock mode: 2139062143
INSERT INTO tst VALUES(1);
-WARNING: int_option = 10
+WARNING: int_option = 5
DROP INDEX test_idx;
SET dummy_index.do_test_reloption_int to false;
-- Test behavior of real option (default and non default values)
@@ -48,9 +50,10 @@
INSERT INTO tst VALUES(1);
WARNING: bool_option = 1
ALTER INDEX test_idx SET (int_option = 5, bool_option = false);
+ERROR: unrecognized lock mode: 2139062143
ALTER INDEX test_idx RESET (bool_option);
INSERT INTO tst VALUES(1);
-WARNING: bool_option = 1
+WARNING: No reloptions is set, default values will be chosen in module runtime
DROP INDEX test_idx;
SET dummy_index.do_test_reloption_bool to false;
-- Test behavior of string option (default and non default values + validate
@@ -68,12 +71,12 @@
WARNING: Validating string option 'Valid_value'
WARNING: string_option = 'Valid_value'
ALTER INDEX test_idx SET (string_option = "Valid_value_2", int_option = 5);
-WARNING: Validating string option 'Valid_value_2'
+ERROR: unrecognized lock mode: 2139062143
INSERT INTO tst VALUES(1);
-WARNING: string_option = 'Valid_value_2'
+WARNING: string_option = 'Valid_value'
ALTER INDEX test_idx RESET (string_option);
INSERT INTO tst VALUES(1);
-WARNING: string_option = 'DefaultValue'
+WARNING: No reloptions is set, default values will be chosen in module runtime
DROP INDEX test_idx;
SET dummy_index.do_test_reloption_string to false;
-- Test behavior of second string option
@@ -87,11 +90,12 @@
"Some_value");
WARNING: string_option2 = 'Some_value'
ALTER INDEX test_idx SET (string_option2 = "Valid_value_2", int_option = 5);
+ERROR: unrecognized lock mode: 2139062143
INSERT INTO tst VALUES(1);
-WARNING: string_option2 = 'Valid_value_2'
+WARNING: string_option2 = 'Some_value'
ALTER INDEX test_idx RESET (string_option2);
INSERT INTO tst VALUES(1);
-WARNING: string_option2 = 'SecondDefaultValue'
+WARNING: No reloptions is set, default values will be chosen in module runtime
DROP INDEX test_idx;
SET dummy_index.do_test_reloption_string2 to false;
SET dummy_index.do_test_reloptions to false;

--
Thomas Munro
https://enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2019-08-01 23:35:06 Re: [HACKERS] WAL logging problem in 9.4.3?
Previous Message Thomas Munro 2019-08-01 23:07:12 Re: Data-only pg_rewind, take 2