Pivotal Knowledge Base

Follow

Cross-Database References are not Implemented

Environment 

Pivotal Greenplum Database (GPDB) all versions

Overview

A simple select of table name with two "." inside, will end up with the following error:

test=#select count(*) from temp.temp.test; 
ERROR: cross-database references are not implemented: "temp.temp.test" 

Cause

A table with two "." inside will be interpreted as database.schema.table

Resolution

Rename the table to keep it only one "." inside could fix the issue.

Additional Information

If there has to be "." in the table name, the creation and selection should be as the following:

gpadmin=# create table "public.test" (a int, b int);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
gpadmin=# select * from "public.test";
 a | b
---+---
(0 rows)

gpadmin=# select * from public."public.test";
 a | b
---+--- 

Comments

Powered by Zendesk