我要創建在不同模式的Greenplum相同的外部表創建相同的表名,但事實證明錯誤:關係「my_external_table_name」已經存在爲什麼Greenplum的不能在不同的架構
click check the picture: this is before create external table
click check the picture: this is after create table
爲什麼我的上一張桌子消失了?
我要創建在不同模式的Greenplum相同的外部表創建相同的表名,但事實證明錯誤:關係「my_external_table_name」已經存在爲什麼Greenplum的不能在不同的架構
click check the picture: this is before create external table
click check the picture: this is after create table
爲什麼我的上一張桌子消失了?
第一
gpadmin=# create schema foo;
gpadmin=# create schema bar;
然後創建模式的外部表創建模式
gpadmin=# CREATE EXTERNAL TABLE foo.fre2(
ngram text,
year int4,
match_count int4,
page_count int4,
volume_count int4)
LOCATION ('gpfdist://mdw:8080/dat.txt')
FORMAT 'TEXT' (DELIMITER E'\t')
LOG ERRORS INTO load_e_fre2 SEGMENT REJECT LIMIT 500 rows;
gpadmin=# CREATE EXTERNAL TABLE bar.fre2(
ngram text,
year int4,
match_count int4,
page_count int4,
volume_count int4)
LOCATION ('gpfdist://mdw:8080/dat.txt')
FORMAT 'TEXT' (DELIMITER E'\t')
LOG ERRORS INTO load_e_fre2 SEGMENT REJECT LIMIT 500 rows;
你應該能夠看到各自的命名空間
gpadmin=# select c.relnamespace, c.relname, e.* from pg_class c join pg_exttable e on e.reloid = c.oid where c.relname = 'fre2';
relnamespace | relname | reloid | location | fmttype | fmtopts | command | rejectlimit | rejectlimittype | fmterrtbl | encoding | writable
--------------+---------+--------+------------------------------+---------+----------------------------------------+---------+-------------+-----------------+-----------+----------+----------
2200 | fre2 | 57474 | {gpfdist://mdw:8080/dat.txt} | t | delimiter ' ' null '\N' escape '\' | | 500 | r | 49164 | 6 | f
57403 | fre2 | 57500 | {gpfdist://mdw:8080/dat.txt} | t | delimiter ' ' null '\N' escape '\' | | 500 | r | 49164 | 6 | f
57404 | fre2 | 57526 | {gpfdist://mdw:8080/dat.txt} | t | delimiter ' ' null '\N' escape '\' | | 500 | r | 49164 | 6 | f
(3 rows)
gpadmin=# select nspname from pg_namespace where oid in (2200, 57403, 57404);
nspname
---------
public
foo
bar
(3 rows)
它不適用於我,我的上一張桌子消失..在不同的架構下使用相同的表名稱不能存在於我的條件中...我已更新我的問題,你可以檢查它看到更多的細節 – Rocke
以下消息是存在的表不是根據前綴「通知」的錯誤它只是通知用戶錯誤表在CREATE語句中定義不存在,因此它正在爲您創建該表。
Notice: Error table "request_histories_external_error" does not exist. Autogenerating and error table with the same name
請分享導致錯誤的語句。 –
我有更新我的問題,你可以看到我上傳的圖片 – Rocke