"ERROR: XX000: This query is not currently supported by GPDB." in VMware Tanzu Greenplum
search cancel

"ERROR: XX000: This query is not currently supported by GPDB." in VMware Tanzu Greenplum

book

Article ID: 296422

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

You receive the following error in VMware Tanzu Greenplum: ERROR: XX000: This query is not currently supported by GPDB. 

One scenario you in which you may encounter this error message is when you: 

1. Create a table of gp_toolkit view:

CREATE TABLE shaque.gp_size_of_schema_disk ( snapshot_sk BIGINT, schema_name TEXT,
tables_size NUMERIC, indexes_size NUMERIC ) 
WITH (appendonly=true, compresstype=quicklz) DISTRIBUTED RANDOMLY; 


2. Then try to insert something into it:

insert into shaque.gp_size_of_schema_disk SELECT to_char(now(),'YYYYMMDD')::int
snapshot_time , sosdnsp schema_name , sosdschematablesize tables_size ,
sosdschemaidxsize indexes_size FROM gp_toolkit.gp_size_of_schema_disk;


Environment

Product Version: 5.12

Resolution

The limitation comes from VMware Tanzu Greenplum query execution model where entry DB QE (QE on master) cannot do dispatch while this SQL needs it.

You can try the following EXECUTE on INITPLAN feature in VMware Tanzu Greenplum 6.5+:
create table my_size_of_schema_disk(like gp_toolkit.gp_size_of_schema_disk); 

alter table my_size_of_schema_disk add column snapshot_time int; 

CREATE OR REPLACE FUNCTION get_data() RETURNS TABLE ( 
schema_name name,
tables_size numeric, 
indexes_size numeric, 
snapshot_time int ) AS $$ BEGIN RETURN QUERY SELECT 
sosdnsp schema_name , 
sosdschematablesize tables_size , 
sosdschemaidxsize indexes_size , 
to_char(now(),'YYYYMMDD')::int snapshot_time 
FROM gp_toolkit.gp_size_of_schema_disk; END; 
$$ LANGUAGE 'plpgsql' EXECUTE ON INITPLAN; 

insert into my_size_of_schema_disk select * from get_data();