|
309 | 309 | using <xref linkend="sql-importforeignschema">. This command creates
|
310 | 310 | foreign table definitions on the local server that match tables or
|
311 | 311 | views present on the remote server. If the remote tables to be imported
|
312 |
| - have columns of user-defined data types, the local server must have types |
313 |
| - of the same names. |
| 312 | + have columns of user-defined data types, the local server must have |
| 313 | +compatible typesof the same names. |
314 | 314 | </para>
|
315 | 315 |
|
316 | 316 | <para>
|
|
361 | 361 |
|
362 | 362 | <para>
|
363 | 363 | Note that constraints other than <literal>NOT NULL</> will never be
|
364 |
| - imported from the remote tables, since <productname>PostgreSQL</> |
365 |
| - does not support any other type of constraint on a foreign table. |
366 |
| - Checking other types of constraints is always left to the remote server. |
| 364 | + imported from the remote tables. Although <productname>PostgreSQL</> |
| 365 | + does support <literal>CHECK</> constraints on foreign tables, there is no |
| 366 | + provision for importing them automatically, because of the risk that a |
| 367 | + constraint expression could evaluate differently on the local and remote |
| 368 | + servers. Any such inconsistency in the behavior of a <literal>CHECK</> |
| 369 | + constraint could lead to hard-to-detect errors in query optimization. |
| 370 | + So if you wish to import <literal>CHECK</> constraints, you must do so |
| 371 | + manually, and you should verify the semantics of each one carefully. |
| 372 | + For more detail about the treatment of <literal>CHECK</> constraints on |
| 373 | + foreign tables, see <xref linkend="sql-createforeigntable">. |
367 | 374 | </para>
|
368 | 375 | </sect3>
|
369 | 376 | </sect2>
|
|