postgresql_16:7.1.64.4 Examples
PostgreSQL 16 > Reference > SQL Commands > CREATE FOREIGN TABLE > Examples
Create foreign table films, which will be accessed through the server film_server: CREATE FOREIGN TABLE films ( code char(5) NOT NULL, title varchar(40) NOT NULL, did integer NOT NULL, date_prod date, kind varchar(10), len interval hour to minute ) SERVER film_server;
Create foreign table measurement_y2016m07, which will be accessed through the server server_07, as a partition of the range partitioned table measurement: CREATE FOREIGN TABLE measurement_y2016m07 PARTITION OF measurement FOR VALUES FROM ('2016-07-01') TO ('2016-08-01') SERVER server_07;