agora inbox for [email protected]help / color / mirror / Atom feed
[PATCH 20/21] f!html: index file 3+ messages / 2 participants [nested] [flat]
* [PATCH 20/21] f!html: index file @ 2022-03-01 05:18 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Justin Pryzby @ 2022-03-01 05:18 UTC (permalink / raw) This allows linking to the artifacts from the last successful build, which itself allows *not* rebuilding when sources haven't changed. ci/os/only: html --- .cirrus.yml | 4 ++-- src/tools/ci/copy-changed-docs | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 53be4f6f4b6..2b7664485f6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -33,7 +33,7 @@ env: # And does the right thing for any 1-patch commits. # Patch series manually submitted to cirrus would benefit from setting this to the # number of patches in the series (or directly to the commit the series was rebased on). - BASE_COMMIT: HEAD~1 + BASE_COMMIT: HEAD~2 # What files to preserve in case tests fail @@ -694,7 +694,7 @@ task: cp -r doc old-docs copy_changed_docs_script: | - src/tools/ci/copy-changed-docs "old-docs" "new-docs" "html_docs" + src/tools/ci/copy-changed-docs "old-docs" "new-docs" "html_docs" "$CIRRUS_BRANCH" html_docs_artifacts: paths: ['html_docs/*.html', 'html_docs/*.png', 'html_docs/*.css'] diff --git a/src/tools/ci/copy-changed-docs b/src/tools/ci/copy-changed-docs index 1584f974d94..b0a4c971aaf 100755 --- a/src/tools/ci/copy-changed-docs +++ b/src/tools/ci/copy-changed-docs @@ -5,10 +5,16 @@ set -e old=$1 new=$2 outdir=$3 +branch=$4 mkdir "$outdir" cp "$new"/src/sgml/html/*.css "$new"/src/sgml/html/*.svg "$outdir" +# The index is useful to allow a static link to the artifacts for the most-recent, successful CI run for a branch +# https://api.cirrus-ci.com/v1/artifact/github/USERNAME/postgres/Documentation/html_docs/html_docs/00-... +index="$outdir/00-doc.html" +echo "<html><head><title>Index of docs changed since: $branch</title></head><body><ul>" >"$index" + changed=`git diff --no-index --name-only "$old"/src/sgml/html "$new"/src/sgml/html` || [ $? -eq 1 ] @@ -17,7 +23,13 @@ do # Avoid removed files [ -f "$f" ] || continue - cp -v "$f" "$outdir" -done + cp -v "$f" "$outdir" >&2 + fn=${f##*/} + # ?branch=... is needed for the static link for the branch + # It's not used if accessing artifacts for *this* CI run + echo "<li><a href='$fn?branch=$branch'>$fn</a>" +done >>"$index" + +echo "</ul></body></html>" >>"$index" exit 0 -- 2.17.1 --mln0rGgUGuXEqmuI Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0021-cirrus-run-freebsd-with-more-CPUs-RAM.patch" ^ permalink raw reply [nested|flat] 3+ messages in thread
* [PATCH v2] Refactor grammar to create opt_utility_option_list @ 2025-07-23 16:13 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Álvaro Herrera @ 2025-07-23 16:13 UTC (permalink / raw) This changes the grammar for REINDEX, CHECKPOINT and CLUSTER; they still accept the same options as before, but the grammar is written differently for convenience of future development. --- src/backend/parser/gram.y | 65 ++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 73345bb3c70..8a6236167db 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -318,6 +318,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query); %type <list> opt_qualified_name %type <boolean> opt_concurrently %type <dbehavior> opt_drop_behavior +%type <list> opt_utility_option_list %type <node> alter_column_default opclass_item opclass_drop alter_using %type <ival> add_drop opt_asc_desc opt_nulls_order @@ -556,7 +557,6 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query); %type <list> generic_option_list alter_generic_option_list %type <ival> reindex_target_relation reindex_target_all -%type <list> opt_reindex_option_list %type <node> copy_generic_opt_arg copy_generic_opt_arg_list_item %type <defelt> copy_generic_opt_elem @@ -1141,6 +1141,11 @@ opt_drop_behavior: | /* EMPTY */ { $$ = DROP_RESTRICT; /* default */ } ; +opt_utility_option_list: + '(' utility_option_list ')' { $$ = $2; } + | /* EMPTY */ { $$ = NULL; } + ; + /***************************************************************************** * * CALL statement @@ -2028,18 +2033,12 @@ constraints_set_mode: * Checkpoint statement */ CheckPointStmt: - CHECKPOINT + CHECKPOINT opt_utility_option_list { CheckPointStmt *n = makeNode(CheckPointStmt); $$ = (Node *) n; - } - | CHECKPOINT '(' utility_option_list ')' - { - CheckPointStmt *n = makeNode(CheckPointStmt); - - $$ = (Node *) n; - n->options = $3; + n->options = $2; } ; @@ -9354,7 +9353,7 @@ DropTransformStmt: DROP TRANSFORM opt_if_exists FOR Typename LANGUAGE name opt_d *****************************************************************************/ ReindexStmt: - REINDEX opt_reindex_option_list reindex_target_relation opt_concurrently qualified_name + REINDEX opt_utility_option_list reindex_target_relation opt_concurrently qualified_name { ReindexStmt *n = makeNode(ReindexStmt); @@ -9367,7 +9366,7 @@ ReindexStmt: makeDefElem("concurrently", NULL, @4)); $$ = (Node *) n; } - | REINDEX opt_reindex_option_list SCHEMA opt_concurrently name + | REINDEX opt_utility_option_list SCHEMA opt_concurrently name { ReindexStmt *n = makeNode(ReindexStmt); @@ -9380,7 +9379,7 @@ ReindexStmt: makeDefElem("concurrently", NULL, @4)); $$ = (Node *) n; } - | REINDEX opt_reindex_option_list reindex_target_all opt_concurrently opt_single_name + | REINDEX opt_utility_option_list reindex_target_all opt_concurrently opt_single_name { ReindexStmt *n = makeNode(ReindexStmt); @@ -9402,10 +9401,6 @@ reindex_target_all: SYSTEM_P { $$ = REINDEX_OBJECT_SYSTEM; } | DATABASE { $$ = REINDEX_OBJECT_DATABASE; } ; -opt_reindex_option_list: - '(' utility_option_list ')' { $$ = $2; } - | /* EMPTY */ { $$ = NULL; } - ; /***************************************************************************** * @@ -11903,49 +11898,61 @@ ClusterStmt: n->params = $3; $$ = (Node *) n; } - | CLUSTER '(' utility_option_list ')' + | CLUSTER qualified_name cluster_index_specification + { + ClusterStmt *n = makeNode(ClusterStmt); + + n->relation = $2; + n->indexname = $3; + n->params = NIL; + $$ = (Node *) n; + } + | CLUSTER opt_utility_option_list { ClusterStmt *n = makeNode(ClusterStmt); n->relation = NULL; n->indexname = NULL; - n->params = $3; + n->params = $2; $$ = (Node *) n; } /* unparenthesized VERBOSE kept for pre-14 compatibility */ - | CLUSTER opt_verbose qualified_name cluster_index_specification + | CLUSTER VERBOSE qualified_name cluster_index_specification { ClusterStmt *n = makeNode(ClusterStmt); n->relation = $3; n->indexname = $4; - n->params = NIL; - if ($2) - n->params = lappend(n->params, makeDefElem("verbose", NULL, @2)); + n->params = list_make1(makeDefElem("verbose", NULL, @2)); $$ = (Node *) n; } /* unparenthesized VERBOSE kept for pre-17 compatibility */ - | CLUSTER opt_verbose + | CLUSTER VERBOSE { ClusterStmt *n = makeNode(ClusterStmt); n->relation = NULL; n->indexname = NULL; - n->params = NIL; - if ($2) - n->params = lappend(n->params, makeDefElem("verbose", NULL, @2)); + n->params = list_make1(makeDefElem("verbose", NULL, @2)); $$ = (Node *) n; } /* kept for pre-8.3 compatibility */ - | CLUSTER opt_verbose name ON qualified_name + | CLUSTER VERBOSE name ON qualified_name { ClusterStmt *n = makeNode(ClusterStmt); n->relation = $5; n->indexname = $3; + n->params = list_make1(makeDefElem("verbose", NULL, @2)); + $$ = (Node *) n; + } + | CLUSTER name ON qualified_name + { + ClusterStmt *n = makeNode(ClusterStmt); + + n->relation = $4; + n->indexname = $2; n->params = NIL; - if ($2) - n->params = lappend(n->params, makeDefElem("verbose", NULL, @2)); $$ = (Node *) n; } ; -- 2.39.5 --x7gweul467fn6trx-- ^ permalink raw reply [nested|flat] 3+ messages in thread
* [PATCH v3] Refactor grammar to create opt_utility_option_list @ 2025-07-23 16:13 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Álvaro Herrera @ 2025-07-23 16:13 UTC (permalink / raw) This changes the grammar for REINDEX, CHECKPOINT and CLUSTER; they still accept the same options as before, but the grammar is written differently for convenience of future development. --- src/backend/parser/gram.y | 43 ++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 73345bb3c70..fc9a8d64c08 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -316,10 +316,11 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query); %type <str> opt_single_name %type <list> opt_qualified_name %type <boolean> opt_concurrently %type <dbehavior> opt_drop_behavior +%type <list> opt_utility_option_list %type <node> alter_column_default opclass_item opclass_drop alter_using %type <ival> add_drop opt_asc_desc opt_nulls_order %type <node> alter_table_cmd alter_type_cmd opt_collate_clause @@ -554,11 +555,10 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query); %type <node> generic_option_arg %type <defelt> generic_option_elem alter_generic_option_elem %type <list> generic_option_list alter_generic_option_list %type <ival> reindex_target_relation reindex_target_all -%type <list> opt_reindex_option_list %type <node> copy_generic_opt_arg copy_generic_opt_arg_list_item %type <defelt> copy_generic_opt_elem %type <list> copy_generic_opt_list copy_generic_opt_arg_list %type <list> copy_options @@ -1139,10 +1139,15 @@ opt_drop_behavior: CASCADE { $$ = DROP_CASCADE; } | RESTRICT { $$ = DROP_RESTRICT; } | /* EMPTY */ { $$ = DROP_RESTRICT; /* default */ } ; +opt_utility_option_list: + '(' utility_option_list ')' { $$ = $2; } + | /* EMPTY */ { $$ = NULL; } + ; + /***************************************************************************** * * CALL statement * *****************************************************************************/ @@ -2026,22 +2031,16 @@ constraints_set_mode: /* * Checkpoint statement */ CheckPointStmt: - CHECKPOINT + CHECKPOINT opt_utility_option_list { CheckPointStmt *n = makeNode(CheckPointStmt); $$ = (Node *) n; - } - | CHECKPOINT '(' utility_option_list ')' - { - CheckPointStmt *n = makeNode(CheckPointStmt); - - $$ = (Node *) n; - n->options = $3; + n->options = $2; } ; /***************************************************************************** @@ -9352,11 +9351,11 @@ DropTransformStmt: DROP TRANSFORM opt_if_exists FOR Typename LANGUAGE name opt_d * REINDEX [ (options) ] {INDEX | TABLE | SCHEMA} [CONCURRENTLY] <name> * REINDEX [ (options) ] {DATABASE | SYSTEM} [CONCURRENTLY] [<name>] *****************************************************************************/ ReindexStmt: - REINDEX opt_reindex_option_list reindex_target_relation opt_concurrently qualified_name + REINDEX opt_utility_option_list reindex_target_relation opt_concurrently qualified_name { ReindexStmt *n = makeNode(ReindexStmt); n->kind = $3; n->relation = $5; @@ -9365,11 +9364,11 @@ ReindexStmt: if ($4) n->params = lappend(n->params, makeDefElem("concurrently", NULL, @4)); $$ = (Node *) n; } - | REINDEX opt_reindex_option_list SCHEMA opt_concurrently name + | REINDEX opt_utility_option_list SCHEMA opt_concurrently name { ReindexStmt *n = makeNode(ReindexStmt); n->kind = REINDEX_OBJECT_SCHEMA; n->relation = NULL; @@ -9378,11 +9377,11 @@ ReindexStmt: if ($4) n->params = lappend(n->params, makeDefElem("concurrently", NULL, @4)); $$ = (Node *) n; } - | REINDEX opt_reindex_option_list reindex_target_all opt_concurrently opt_single_name + | REINDEX opt_utility_option_list reindex_target_all opt_concurrently opt_single_name { ReindexStmt *n = makeNode(ReindexStmt); n->kind = $3; n->relation = NULL; @@ -9400,14 +9399,10 @@ reindex_target_relation: ; reindex_target_all: SYSTEM_P { $$ = REINDEX_OBJECT_SYSTEM; } | DATABASE { $$ = REINDEX_OBJECT_DATABASE; } ; -opt_reindex_option_list: - '(' utility_option_list ')' { $$ = $2; } - | /* EMPTY */ { $$ = NULL; } - ; /***************************************************************************** * * ALTER TABLESPACE * @@ -11901,53 +11896,49 @@ ClusterStmt: n->relation = $5; n->indexname = $6; n->params = $3; $$ = (Node *) n; } - | CLUSTER '(' utility_option_list ')' + | CLUSTER opt_utility_option_list { ClusterStmt *n = makeNode(ClusterStmt); n->relation = NULL; n->indexname = NULL; - n->params = $3; + n->params = $2; $$ = (Node *) n; } /* unparenthesized VERBOSE kept for pre-14 compatibility */ | CLUSTER opt_verbose qualified_name cluster_index_specification { ClusterStmt *n = makeNode(ClusterStmt); n->relation = $3; n->indexname = $4; - n->params = NIL; if ($2) - n->params = lappend(n->params, makeDefElem("verbose", NULL, @2)); + n->params = list_make1(makeDefElem("verbose", NULL, @2)); $$ = (Node *) n; } /* unparenthesized VERBOSE kept for pre-17 compatibility */ - | CLUSTER opt_verbose + | CLUSTER VERBOSE { ClusterStmt *n = makeNode(ClusterStmt); n->relation = NULL; n->indexname = NULL; - n->params = NIL; - if ($2) - n->params = lappend(n->params, makeDefElem("verbose", NULL, @2)); + n->params = list_make1(makeDefElem("verbose", NULL, @2)); $$ = (Node *) n; } /* kept for pre-8.3 compatibility */ | CLUSTER opt_verbose name ON qualified_name { ClusterStmt *n = makeNode(ClusterStmt); n->relation = $5; n->indexname = $3; - n->params = NIL; if ($2) - n->params = lappend(n->params, makeDefElem("verbose", NULL, @2)); + n->params = list_make1(makeDefElem("verbose", NULL, @2)); $$ = (Node *) n; } ; cluster_index_specification: -- 2.39.5 --qmcdp5jd4farbum3-- ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2025-07-23 16:13 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-03-01 05:18 [PATCH 20/21] f!html: index file Justin Pryzby <[email protected]> 2025-07-23 16:13 [PATCH v2] Refactor grammar to create opt_utility_option_list Álvaro Herrera <[email protected]> 2025-07-23 16:13 [PATCH v3] Refactor grammar to create opt_utility_option_list Álvaro Herrera <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox