You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE OR REPLACE FUNCTION AUTOUSER (uname varchar(20))
RETURNS TEXT AS $$
BEGIN
execute format('CREATE USER %I WITH PASSWORD %L', uname, 'myuser');
execute format('GRANT ALL ON DATABASE mydb TO %I', uname);
execute format('GRANT ALL ON ALL TABLES IN SCHEMA public TO %I', uname);
RETURN CONCAT(uname,' Created');
END;
$$
LANGUAGE plpgsql;
In this example, while executing execute format('CREATE USER %I WITH PASSWORD %L', uname, 'myuser');, only the post_parse_analyze hook is called where the metadata is set, but no ProcessUtility/ExecutorEnd hook is called to unset the metadata
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information
I confirm this issue does not contain any sensitive information.
The text was updated successfully, but these errors were encountered:
…ements is tracking it
Summary:
ASH's query id is the same as the one present in the pg_stat_statements view. In case of
nested queries, pg_stat_statements may or may not track them, depending on the guc
`pg_stat_statements.track`. This diff tracks the nested query ids with ASH only if
pg_stat_statements is also doing it.
This diff also avoids setting the query id in the post_parse_analyze hook, because in some
cases of nested queries, only the post_parse_analyze hook is called and no subsequent
ExecutorEnd / ProcessUtility hook is called, in which case we would push the query id to the
stack but never pop it. Now, we start tracking the query id at the start of ExecutorStart /
ProcessUtility hook and stop tracking it at the end of ExecutorEnd / ProcessUtility hook or
if there is some error encountered in between.
Jira: DB-10002, DB-11281
Test Plan: ./yb_build.sh --java-test TestYbAsh#testNestedQueriesWithAsh
Reviewers: jason
Reviewed By: jason
Subscribers: hbhanawat, yql, amitanand
Differential Revision: https://phorge.dev.yugabyte.com/D34773
…ements is tracking it
Summary:
ASH's query id is the same as the one present in the pg_stat_statements view. In case of
nested queries, pg_stat_statements may or may not track them, depending on the guc
`pg_stat_statements.track`. This diff tracks the nested query ids with ASH only if
pg_stat_statements is also doing it.
This diff also avoids setting the query id in the post_parse_analyze hook, because in some
cases of nested queries, only the post_parse_analyze hook is called and no subsequent
ExecutorEnd / ProcessUtility hook is called, in which case we would push the query id to the
stack but never pop it. Now, we start tracking the query id at the start of ExecutorStart /
ProcessUtility hook and stop tracking it at the end of ExecutorEnd / ProcessUtility hook or
if there is some error encountered in between.
Jira: DB-10002, DB-11281
Test Plan: ./yb_build.sh --java-test TestYbAsh#testNestedQueriesWithAsh
Reviewers: jason
Reviewed By: jason
Subscribers: hbhanawat, yql, amitanand
Differential Revision: https://phorge.dev.yugabyte.com/D34773
Jira Link: DB-11281
Description
In this example, while executing
execute format('CREATE USER %I WITH PASSWORD %L', uname, 'myuser');
, only thepost_parse_analyze
hook is called where the metadata is set, but noProcessUtility
/ExecutorEnd
hook is called to unset the metadataIssue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: