Skip to content

Commit

Permalink
Add logs to citus_stats_tenants
Browse files Browse the repository at this point in the history
  • Loading branch information
halilozanakgul committed Mar 27, 2023
1 parent b989e88 commit 7c994ac
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CREATE OR REPLACE FUNCTION pg_catalog.citus_stats_tenants (
LANGUAGE plpgsql
AS $function$
BEGIN
RAISE LOG 'Generating citus_stats_tenants';
RETURN QUERY
SELECT *
FROM jsonb_to_recordset((
Expand Down
10 changes: 10 additions & 0 deletions src/test/regress/expected/citus_stats_tenants.out
Original file line number Diff line number Diff line change
Expand Up @@ -264,5 +264,15 @@ SELECT tenant_attribute, read_count_in_this_period, read_count_in_last_period, q

\c - - - :master_port
SET search_path TO citus_stats_tenants;
-- test logs
SET client_min_messages TO LOG;
SELECT count(*)>=0 FROM citus_stats_tenants;
LOG: Generating citus_stats_tenants
CONTEXT: PL/pgSQL function citus_stats_tenants(boolean) line XX at RAISE
?column?
---------------------------------------------------------------------
t
(1 row)

SET client_min_messages TO ERROR;
DROP SCHEMA citus_stats_tenants CASCADE;
4 changes: 4 additions & 0 deletions src/test/regress/sql/citus_stats_tenants.sql
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,9 @@ SELECT tenant_attribute, read_count_in_this_period, read_count_in_last_period, q
\c - - - :master_port
SET search_path TO citus_stats_tenants;

-- test logs
SET client_min_messages TO LOG;
SELECT count(*)>=0 FROM citus_stats_tenants;

SET client_min_messages TO ERROR;
DROP SCHEMA citus_stats_tenants CASCADE;

0 comments on commit 7c994ac

Please sign in to comment.