EPUB | CHM | PDF

TPSQLDump.Properties.TableNames

Top Previous Next

Dump data for specified tables only.

Syntax:

property TableNames: TStrings;

Description:

If items count is greater then zero, then TPSQLDump tries to dump data for specified tables only. It is possible for there to be multiple tables with the same name in different schemas; if that is the case, all matching tables will be dumped. Also, if any POSIX regular expression character appears in the table name (([{\.?+, the string will be interpreted as a regular expression. Note that when in regular expression mode, the string will not be anchored to the start/end unless ^ and $ are used at the beginning/end of the string.

The properties ExcludeTables, SchemaNames, and ExcludeSchemas can be used together to achieve a high degree of control over what is dumped. The SchemaNames and ExcludeSchemas lists are proceeded first to create a list of schemas to dump, and then the table lists are parsed to only find tables in the matching schemas.

Example:

This example shows how to dump all tables starting with employee in the detroit schema, except for the table named employee_log:

PSQLDump.SchemaNames.Clear;
PSQLDump.SchemaNames.Append('detroit');
PSQLDump.TableNames.Clear;
PSQLDump.TableNames.Append('^employee');
PSQLDump.ExcludeTables.Clear;
PSQLDump.ExcludeTables.Append('employee_log');

In this mode, TPSQLDump makes no attempt to dump any other database objects that the selected table may depend upon. Therefore, there is no guarantee that the results of a single-table dump can be successfully restored by themselves into a clean database.

See also: ExcludeTables, SchemaNames, ExcludeSchemas