Table of Contents Previous Next


3 EDB*Loader : 3.4 Invoking EDB*Loader

edbldr [ -d dbname ] [ -p port ] [ -h host ]
[ USERID={ username/password | username/ | username | / } ]
CONTROL=control_file
[ DATA=data_file ]
[ BAD=bad_file ]
[ DISCARD=discard_file ]
[ DISCARDMAX=max_discard_recs ]
[ LOG=log_file ]
[ PARFILE=param_file ]
[ ERRORS=error_count ]
[ SKIP=skip_count ]
If the -d option, the -p option, or the -h option are omitted, the defaults for the database, port, and host are determined according to the same rules as other Advanced Server utility programs such as edb-psql, for example.
Any parameter listed in the preceding syntax diagram except for the -d option, -p option, -h option, and the PARFILE parameter may be specified in a parameter file. The parameter file is specified on the command line when edbldr is invoked using PARFILE=param_file. Some parameters may be specified in the OPTIONS clause in the control file. See the description of the control file in Section 3.3.
The specification of control_file, data_file, bad_file, discard_file, log_file, and param_file may include the full directory path or a relative directory path to the file name. If the file name is specified alone or with a relative directory path, the file is assumed to exist (in the case of control_file, data_file, or param_file), or to be created (in the case of bad_file, discard_file, or log_file) relative to the current working directory from which edbldr is invoked.
Note: The control file must exist in the character set encoding of the client where edbldr is invoked. If the client is in a different encoding than the database encoding, then the PGCLIENTENCODING environment variable must be set on the client to the client’s encoding prior to invoking edbldr. This must be done to ensure character set conversion is properly done between the client and the database server.
The operating system account used to invoke edbldr must have read permission on the directories and files specified by control_file, data_file, and param_file.
The operating system account enterprisedb must have write permission on the directories where bad_file, discard_file, and log_file are to be written.
Note: It is suggested that the file names for control_file, data_file, bad_file, discard_file, and log_file include extensions of .ctl, .dat, .bad, .dsc, and .log, respectively. If the provided file name does not contain an extension, EDB*Loader assumes the actual file name includes the appropriate aforementioned extension.
USERID={ username/password | username/ | username | / }
EDB*Loader connects to the database with username. username must be a superuser. password is the password for username.
If the USERID parameter is omitted, EDB*Loader prompts for username and password. If USERID=username/ is specified, then EDB*Loader 1) uses the password file specified by environment variable PGPASSFILE if PGPASSFILE is set, or 2) uses the .pgpass password file (pgpass.conf on Windows systems) if PGPASSFILE is not set. If USERID=username is specified, then EDB*Loader prompts for password. If USERID=/ is specified, the connection is attempted using the operating system account as the user name.
Note: The Advanced Server connection environment variables PGUSER and PGPASSWORD are ignored by EDB*Loader. See the PostgreSQL core documentation for information on the PGPASSFILE environment variable and the password file.
CONTROL=control_file
control_file specifies the name of the control file containing EDB*Loader directives. If a file extension is not specified, an extension of .ctl is assumed. See Section 3.3 for a description of the control file.
DATA=data_file
data_file specifies the name of the file containing the data to be loaded into the target table. If a file extension is not specified, an extension of .dat is assumed. See Section 3.3 for a description of the data_file.
Note: Specifying a data_file on the command line overrides the INFILE clause specified in the control file.
BAD=bad_file
bad_file specifies the name of a file that receives input data records that cannot be loaded due to errors. See Section 3.3 for a description of the bad_file.
Note: Specifying a bad_file on the command line overrides any BADFILE clause specified in the control file.
DISCARD=discard_file
discard_file is the name of the file that receives input data records that do not meet any table’s selection criteria. See the description of discard_file in Section 3.3.
Note: Specifying a discard_file using the command line DISCARD parameter overrides the DISCARDFILE clause in the control file.
DISCARDMAX=max_discard_recs
max_discard_recs is the maximum number of discarded records that may be encountered from the input data records before terminating the EDB*Loader session. See the description of max_discard_recs in Section3.3.
Note: Specifying max_discard_recs using the command line DISCARDMAX parameter overrides the DISCARDMAX or DISCARDS clause in the control file.
LOG=log_file
log_file specifies the name of the file in which EDB*Loader records the results of the EDB*Loader session.
If the LOG parameter is omitted, EDB*Loader creates a log file with the name control_file_base.log in the directory from which edbldr is invoked. control_file_base is the base name of the control file used in the EDB*Loader session. The operating system account enterprisedb must have write permission on the directory where the log file is to be written.
PARFILE=param_file
param_file specifies the name of the file that contains command line parameters for the EDB*Loader session. Any command line parameter listed in this section except for the -d, -p, and -h options, and the PARFILE parameter itself, can be specified in param_file instead of on the command line.
Any parameter given in param_file overrides the same parameter supplied on the command line before the PARFILE option. Any parameter given on the command line that appears after the PARFILE option overrides the same parameter given in param_file.
Note: Unlike other EDB*Loader files, there is no default file name or extension assumed for param_file, though by Oracle SQL*Loader convention, .par is typically used, but not required, as an extension.
If DIRECT is set to TRUE EDB*Loader performs a direct path load instead of a conventional path load. The default value of DIRECT is FALSE.
See Section 3.5 for information on direct path loads.
Set FREEZE to TRUE to indicate that the data should be copied with the rows frozen. A tuple guaranteed to be visible to all current and future transactions is marked as frozen to prevent transaction ID wrap-around. For more information about frozen tuples, see the PostgreSQL core documentation at:
You must specify a data-loading type of TRUNCATE in the control file when using the FREEZE option. FREEZE is not supported for direct loading.
By default, FREEZE is FALSE.
ERRORS=error_count
error_count specifies the number of errors permitted before aborting the EDB*Loader session. The default is 50.
Set PARALLEL to TRUE to 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 of PARALLEL is FALSE.
When PARALLEL is TRUE, the DIRECT parameter must also be set to TRUE . See Section 3.6 for more information about parallel direct path loads.
n specifies the number of rows that EDB*Loader will commit before loading the next set of n rows.
SKIP=skip_count
If set to TRUE, index maintenance is not performed as part of a direct path load, and indexes on the loaded table are marked as invalid. The default value of SKIP_INDEX_MAINTENANCE is FALSE.
You can use the REINDEX command to rebuild an index. For more information about the REINDEX command, see the PostgreSQL core documentation available at:
group_name specifies the name of an EDB Resource Manager resource group to which the EDB*Loader session is to be assigned.
Any default resource group that may have been assigned to the session (for example, a database user running the EDB*Loader session who had been assigned a default resource group with the ALTER ROLE ... SET edb_resource_group command) is overridden by the resource group given by the edb_resource_group parameter specified on the edbldr command line.
In the following example EDB*Loader is invoked using a control file named emp.ctl located in the current working directory to load a table in database edb:
The following example runs EDB*Loader with the same parameters as shown in the preceding example, but using a parameter file located in the current working directory. The SKIP and ERRORS parameters are altered from their defaults in the parameter file as well. The parameter file, emp.par, contains the following:

3 EDB*Loader : 3.4 Invoking EDB*Loader

Table of Contents Previous Next