Skip to content

Commit

Permalink
Detect CitusDB by checking for its catalogs
Browse files Browse the repository at this point in the history
More obvious than checking for some GUC.
  • Loading branch information
jasonmp85 committed May 23, 2015
1 parent 42749a6 commit 77d0839
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pg_shard--1.2.sql
Expand Up @@ -11,14 +11,13 @@ LANGUAGE C STABLE STRICT;

DO $$
DECLARE
replication_factor integer;
use_citus_metadata boolean := false;
BEGIN
BEGIN
replication_factor = current_setting('shard_replication_factor')::integer;
use_citus_metadata = (replication_factor IS NOT NULL);
PERFORM 'pg_catalog.pg_dist_partition'::regclass;
use_citus_metadata = true;
EXCEPTION
WHEN undefined_object THEN
WHEN undefined_table THEN
use_citus_metadata = false;
END;

Expand Down

0 comments on commit 77d0839

Please sign in to comment.