EDB*Loader control file parameters v17
Use the following parameters when building the EDB*Loader control file.
OPTIONS param=value
Use the OPTIONS clause to specify param=value pairs that represent an EDB*Loader directive. If you specify a parameter in the OPTIONS clause and on the command line when edbldr is invoked, the command line setting takes effect.
Specify one or more of the following parameter/value pairs:
DIRECT= { FALSE | TRUE }With
DIRECTset toTRUE, EDB*Loader performs a direct path load instead of a conventional path load. The default value ofDIRECTisFALSE.Don't set
DIRECT=truewhen loading the data into a replicated table. If you're using EDB*Loader to load data into a replicated table and setDIRECT=true, indexes might omit rows that are in a table or can potentially contain references to rows that were deleted. Direct inserts to load data into replicated tables aren't supported.For information on direct path loads see, Direct path load.
ERRORS=error_counterror_countspecifies the number of errors permitted before aborting the EDB*Loader session. The default is50.FREEZE= { FALSE | TRUE }Set
FREEZEtoTRUEto copy the data with the rowsfrozen. A tuple guaranteed to be visible to all current and future transactions is marked as frozen to prevent transaction ID wraparound. For more information about frozen tuples, see the PostgreSQL core documentation.You must specify a data-loading type of
TRUNCATEin the control file when using theFREEZEoption.FREEZEisn't supported for direct loading.By default,
FREEZEisFALSE.PARALLEL= { FALSE | TRUE }Set
PARALLELtoTRUEto indicate that this EDB*Loader session is one of a number of concurrent EDB*Loader sessions participating in a parallel direct path load. The default value ofPARALLELisFALSE.When
PARALLELisTRUE, you must also set theDIRECTparameter toTRUE. For more information about parallel direct path loads, see Parallel direct path load.ROWS=nnspecifies the number of rows that EDB*Loader commits before loading the next set ofnrows.If EDB*Loader encounters an invalid row during a load in which the
ROWSparameter is specified, those rows committed prior to encountering the error remain in the destination table.SKIP=skip_countskip_countspecifies the number of records at the beginning of the input data file to skip before loading begins. The default is0.SKIP_INDEX_MAINTENANCE={ FALSE | TRUE }If
SKIP_INDEX_MAINTENANCEisTRUE, index maintenance isn't performed as part of a direct path load, and indexes on the loaded table are marked as invalid. The default value ofSKIP_INDEX_MAINTENANCEisFALSE.Note
During a parallel direct path load, target table indexes aren't updated. They are marked as invalid after the load is complete.
You can use the
REINDEXcommand to rebuild an index. For more information about theREINDEXcommand, see the PostgreSQL core documentation.
charset
Use the CHARACTERSET clause to identify the character set encoding of data_file, where charset is the character set name. This clause is required if the data file encoding differs from the control file encoding. The control file encoding must always be in the encoding of the client where edbldr is invoked.
Examples of charset settings are UTF8, SQL_ASCII, and SJIS.
For more information about client-to-database character-set conversion, see the PostgreSQL core documentation.
data_file
File containing the data to load into target_table. Each record in the data file corresponds to a row to insert into target_table.
If you don't include an extension in the file name, EDB*Loader assumes the file has an extension of .dat, for example, mydatafile.dat.
!!! Note
If you specify the DATA parameter on the command line when invoking edbldr, the file given by the command line DATA parameter is used instead.
If you omit the INFILE clause and the command line DATA parameter, then the data file name is assumed to be the same as the control file name but with the extension .dat.
stdin
Specify stdin (all lowercase letters) if you want to use standard input to pipe the data to load directly to EDB*Loader. This technique is useful for data sources generating a large number of records to load.
bad_file
A file that receives data_file records that can't load due to errors. The bad file is generated for collecting rejected or bad records.
For EDB Postgres Advanced Server version 12 and later, a bad file is generated only if there are any bad or rejected records. However, if an existing bad file has the same name and location, and no bad records are generated after invoking a new version of edbldr, the existing bad file remains intact.
If you don't include an extension in the file name, EDB*Loader assumes the file has an extension of .bad, for example, mybadfile.bad.
!!! Note
If you specify the BAD parameter on the command line when invoking edbldr, the file given with the command line BAD parameter is used instead.
discard_file
File that receives input data records that aren't loaded into any table. This input data records are discarded because none of the selection criteria are met for tables with the WHEN clause and there are no tables without a WHEN clause. All records meet the selection criteria of a table without a WHEN clause.
If you don't include an extension with the file name, EDB*Loader assumes the file has an extension of .dsc, for example, mydiscardfile.dsc.
!!! Note
If you specify the DISCARD parameter on the command line when invoking edbldr, the file given with the command line DISCARD parameter is used instead.
max_discard_recs
Maximum number of discarded records that the input data records can encounter before terminating the EDB*Loader session. You can use either keyword DISCARDMAX or DISCARDS preceding the integer value specified by max_discard_recs.
For example, if max_discard_recs is 0, then the EDB*Loader session is terminated when a first discarded record is encountered. If max_discard_recs is 1, then the EDB*Loader session is terminated when a second discarded record is encountered.
When the EDB*Loader session is terminated due to exceeding max_discard_recs, prior input data records that were loaded into the database are retained. They aren't rolled back.
INSERT, APPEND, REPLACE, TRUNCATE
Specifies how to load data into the target tables. Specifying one of INSERT, APPEND, REPLACE, or TRUNCATE establishes the default action for all tables, overriding the default of INSERT.
INSERTData is loaded into an empty table. EDB*Loader throws an exception and doesn't load any data if the table isn't initially empty.
Note
If the table contains rows, you must use the
TRUNCATEcommand to empty the table before invoking EDB*Loader. EDB*Loader throws an exception if you use theDELETEcommand to empty the table instead of theTRUNCATEcommand. Oracle SQL*Loader allows you to empty the table by using either theDELETEorTRUNCATEcommand.APPENDData is added to any existing rows in the table. The table also can be empty initially.
REPLACEThe
REPLACEkeyword andTRUNCATEkeywords are functionally identical. The table is truncated by EDB*Loader before loading the new data.Note
Delete triggers on the table aren't fired as a result of the
REPLACEoperation.TRUNCATEThe table is truncated by EDB*Loader before loading the new data. Delete triggers on the table aren't fired as a result of the
TRUNCATEoperation.
PRESERVE BLANKS
The PRESERVE BLANKS option retains leading and trailing whitespaces for both delimited and predetermined size fields.
In case of NO PRESERVE BLANKS, if the fields are delimited, then only leading whitespaces are omitted. If any trailing whitespaces are present, they are left intact. In the case of predetermined-sized fields with NO PRESERVE BLANKS, the trailing whitespaces are omitted. Any leading whitespaces are left intact.
!!! Note
If you don't explicitly provide PRESERVE BLANKS or NO PRESERVE BLANKS, then the behavior defaults to NO PRESERVE BLANKS. This option doesn't work for ideographic whitespaces.
target_table
Name of the table into which to load data. The table name can be schema-qualified (for example, enterprisedb.emp). The specified target can't be a view.
field_condition
Conditional clause taking the following form: