From 348f57ce5be96190491e2153abb47060884f8ebf Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 8 Apr 2019 13:47:46 +0200 Subject: [PATCH] doc: Add note about generated columns in foreign tables Explain that it is not enforced that querying a generated column returns data that is consistent with the data that was stored. This is similar to the note about constraints nearby. Reported-by: Amit Langote --- doc/src/sgml/ref/create_foreign_table.sgml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/src/sgml/ref/create_foreign_table.sgml b/doc/src/sgml/ref/create_foreign_table.sgml index 6b15726517..5db15eb73e 100644 --- a/doc/src/sgml/ref/create_foreign_table.sgml +++ b/doc/src/sgml/ref/create_foreign_table.sgml @@ -350,6 +350,16 @@ CHECK ( expression ) [ NO INHERIT ] reality. + + Similar considerations apply to generated columns. Stored generated + columns are computed on insert or update on the local + PostgreSQL server and handed to the + foreign-data wrapper for writing out to the foreign data store, but it is + not enforced that a query of the foreign table returns values for stored + generated columns that are consistent with the generation expression. + Again, this might result in incorrect query results. + + While rows can be moved from local partitions to a foreign-table partition (provided the foreign data wrapper supports tuple routing), they cannot be -- 2.49.0