Create schemas first
gpadmin=# create schema foo;
gpadmin=# create schema bar;
then create external tables in schemas
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;
You should be able to see tables exist in their respective namespaces
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)