LD_LIBRARY_PATH=/dbi/odbc/unixodbc2310/lib:/dbi/ postgres/9.03.04/lib:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH=${LD_LIBRARY_PATH%:} export ODBCSYSINI=/dbi/postgres/9.03.04 export PATH=/dbi/postgres/9.03.04/bin:$PATH unset LANG export PGCLIENTENCODING=UTF8
driver=sql;conopts=(driver=postgres;catalog=acat; uid=myuid;pwd='123pass';server=sv.abc.123.com; port=5432;DB=mydb;schema=public)
Option
|
Description
|
---|---|
CATALOG
|
CATALOG=catalog-identifier; Specifies an arbitrary
identifier for an SQL catalog, which groups schemas that are logically
related (for example,
catalog=ptgtest ).
Note: The FedSQL language processor
automatically quotes SQL identifiers that do not meet the regular
naming convention as defined in SAS FedSQL Reference Guide.
|
CONOPTS
|
CONOPTS=(ODBC—compliant
database connection string); Specifies an ODBC-compliant
database connection string using ODBC-style syntax. These options,
combined with the ODBC_DSN option, must specify a complete connection
string to the data source. If you include a DSN= or FILEDSN= specification
within the CONOPTS= option, do not use the ODBC_DSN= connection option.
However, you can specify the ODBC database-specific connection options
by using CONOPTS=. Then you can specify an ODBC DSN that contains
other connection information by using the ODBC_DSN= connection option.
Here is an example string
using the CONOPTS option:
driver=sql;conopts= ((driver=odbc;catalog=acat;conopts=(dsn=ODBCPgresDD;pwd=Tester2)); (driver=postgres;catalog=bcat;uid=myuid2;pwd='123mypass'; server=sv.abc.123.com;port=5432;DB=mydb;schema=public))" |
DRIVER
|
DRIVER=postgres ;
Specifies the data service
for the PostgreSQL database to which you want to connect.
Note: DRIVER is a required option.
You must specify a driver.
|
DATABASE
|
DATABASE=database-name; Specifies the name of
the PostgreSQL database. Enclose the database name in single quotation
marks if it contains spaces or non-alphanumeric characters. You can
also specify DATABASE= with the DB= alias.
database=sample,
DB=sample .
|
DSN
|
DSN=data-source-identifier; Specifies the data source
name to which you want to connect.
|
PWD
|
PWD=password; Specifies the password
associated with the user ID. Enclose password in single quotation
marks if it contains spaces or non-alphanumeric characters. You can
also specify PASSWORD= with the PWD=, PASS=, and PW= aliases.
|
PORT
|
PORT=port_number Specifies the port number
that is used to connect to the specified PostgreSQL Server. If you
do not specify a port, the default is 5432.
|
SERVER
|
SERVER=‘server-name’ Specifies the server
name or IP address of the PostgreSQL server to which you want to connect.
Enclose the server name in single quotation marks if the name contains
spaces or non-alphanumeric characters:
SERVER=’server
name’ .
|
USER
|
USER=user-name Specifies the PostgreSQL
user name (also called the user ID) that you use to connect to your
database. If the user name contains spaces or non-alphanumeric characters,
you must enclose it in quotation marks.
|
Option
|
Description
|
||||||
---|---|---|---|---|---|---|---|
ALLOW_UNQUOTED_NAMES
|
ALLOW_UNQUOTED_NAMES=NO|YES Specifies whether to
enclose table and column names in quotation marks. Tables and columns
are quoted when this option is set at NO. If set to YES, the driver
does not automatically add quotation marks to table and column names
if they are not specified. This allows PostgreSQL tables and columns
to be created in the default lowercase. The default option is NO.
|
||||||
CLIENT_ENCODING
|
CLIENT_ENCODING=cei Used to specify encoding
for the client.
|
||||||
CT_PRESERVE
|
CT_PRESERVE=STRICT
| SAFE | FORCE | FORCE_COL_SIZE Enables users to control
how data types are mapped. Note that data type mapping is disabled
when CT_PRESERVE is set to STRICT. If the requested type does not
exist on the target database, an error is returned. Here are the options:
|
||||||
DEFAULT_ATTR
|
DEFAULT_ATTR=(attr=value;...) Used to specify connection
handle or statement handle attributes supported for initial connect-time
configuration, where
attr=value corresponds
to any of the following options:
|
||||||
DRIVER_TRACE
|
DRIVER_TRACE=’API
| SQL | ALL’; Requests tracing information,
which logs transaction records to an external file that can be used
for debugging purposes. The driver writes a record of each command
that is sent to the database to the trace log based on the specified
tracing level, which determines the type of tracing information. Here
are the tracing levels:
Default: Tracing
is not activated.
Note: If you activate tracing,
you must also specify the location of the trace log with DRIVER_TRACEFILE=.
Note that DRIVER_TRACEFILE= is resolved against the TRACEFILEPATH
set in ALTER SERVER. TRACEFILEPATH is relative to the server's
content root location.
(Optional) You can control
trace log formatting with DRIVER_TRACEOPTIONS=.
Interaction: You
can specify one trace level, or you can concatenate more than one
by including the | (OR) symbol. For example,
driver_trace='api|sql' generates
tracing information for API calls and SQL statements.
|
||||||
DRIVER_TRACEFILE
|
DRIVER_TRACEFILE=’filename’ ;
Used to specify the
name of the text file for the trace log. Include the filename and
extension in single or double quotation marks (for example,
driver_tracefile='\mytrace.log' ).
Default: The
default TRACEFILE location applies to a relative filename, and it
is placed relative to TRACEFILEPATH.
Requirement: DRIVER_TRACEFILE
is required when activating tracing using DRIVER_TRACE.
Interaction: (Optional)
You can control trace log formatting with DRIVER_TRACEOPTIONS=.
|
||||||
DRIVER_TRACEOPTIONS
|
DRIVER_TRACEOPTIONS=APPEND
| THREADSTAMP | TIMESTAMP; Specifies options in
order to control formatting and other properties for the trace log:
Default: The
trace log is overwritten with no thread identification or time stamp.
|
||||||
MAX_BINARY_LEN
|
MAX_BINARY_LEN=value; Specifies a value, in
bytes, that limits the length of long binary fields (LONG VARBINARY).
Unlike other databases, PostgreSQL does not have a size limit for
long binary fields. The default is 1048576.
|
||||||
MAX_CHAR_LEN
|
MAX_CHAR_LEN=value; Specifies a value that
limits the length of character fields (CHAR and VARCHAR). The default
is 2000.
|
||||||
MAX_TEXT_LEN
|
MAX_TEXT_LEN=value; Specifies a value that
limits the length of long character fields (LONG VARCHAR). The default
is 409500.
|
||||||
SCHEMA
|
SCHEMA=value; Specifies the default
schema for the connection. If not specified, the schema, or list of
schemas, is determined based on the value of the schema search path
that is defined on the database server.
|
||||||
STRIP_BLANKS
|
STRIP_BLANKS=YES|NO; Specifies whether to
strip blanks from character fields.
|