čt 19. 3. 2020 v 10:43 odesílatel DUVAL REMI <remi.du...@cheops.fr> napsal:
> Hello > > > > I played around with the ALTER VARIABLE statement to make sure it’s OK and > it seems fine to me. > > > > Another last thing before commiting. > > > > I agree with Thomas Vondra, that this part might/should be simplified : > > > > [ { ON COMMIT DROP | ON { TRANSACTIONAL | TRANSACTION } END RESET } ] > > > > I would only allow “ON TRANSACTION END RESET”. > > I think we don’t need both here. > > Philippe Beaudoin was indeed talking about the TRANSACTIONAL keyword, but > that would have make sense (and I think that’s what he meant) , if you > could do something like “CREATE [NON] TRANSACTIONAL VARIABLE …”. > > But here I don’t think that the ON TRANSACTIONAL END RESET has any sense > in English, and it only complicates the syntax. > > > > Maybe Thomas Vondra (if it’s him) would be more inclined to commit the > patch if it has this more simple syntax has he requested. > > > > What do you think ? > I removed TRANSACTIONAL from this clause, see attachement change.diff Updated patch attached. I hope it would be the last touch, making it fully ready for a commiter. > Thank you very much for review and testing Pavel >
diff --git a/doc/src/sgml/ref/create_variable.sgml b/doc/src/sgml/ref/create_variable.sgml index 1b1883a11a..cf175e05c6 100644 --- a/doc/src/sgml/ref/create_variable.sgml +++ b/doc/src/sgml/ref/create_variable.sgml @@ -22,7 +22,7 @@ PostgreSQL documentation <refsynopsisdiv> <synopsis> CREATE [ { TEMPORARY | TEMP } ] [ IMMUTABLE ] VARIABLE [ IF NOT EXISTS ] <replaceable class="parameter">name</replaceable> [ AS ] <replaceable class="parameter">data_type</replaceable> ] [ COLLATE <replaceable class="parameter">collation</replaceable> ] - [ NOT NULL ] [ DEFAULT <replaceable class="parameter">default_expr</replaceable> ] [ { ON COMMIT DROP | ON { TRANSACTIONAL | TRANSACTION } END RESET } ] + [ NOT NULL ] [ DEFAULT <replaceable class="parameter">default_expr</replaceable> ] [ { ON COMMIT DROP | ON { TRANSACTION } END RESET } ] </synopsis> </refsynopsisdiv> <refsect1> diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 744342733d..c135a35d07 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -4567,7 +4567,6 @@ OptSchemaVarDefExpr: DEFAULT b_expr { $$ = $2; } OnEOXActionOption: ON COMMIT DROP { $$ = VARIABLE_EOX_DROP; } | ON TRANSACTION END_P RESET { $$ = VARIABLE_EOX_RESET; } - | ON TRANSACTIONAL END_P RESET { $$ = VARIABLE_EOX_RESET; } | /*EMPTY*/ { $$ = VARIABLE_EOX_NOOP; } ; diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index d39bcfe9cf..d26b0efcd9 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -5978,7 +5978,7 @@ proname => 'pg_collation_is_visible', procost => '10', provolatile => 's', prorettype => 'bool', proargtypes => 'oid', prosrc => 'pg_collation_is_visible' }, -{ oid => '4191', descr => 'is schema variable visible in search path?', +{ oid => '4142', descr => 'is schema variable visible in search path?', proname => 'pg_variable_is_visible', procost => '10', provolatile => 's', prorettype => 'bool', proargtypes => 'oid', prosrc => 'pg_variable_is_visible' },
schema-variables-20200320.patch.gz
Description: application/gzip