head	1.11;
access;
symbols
	REL-09_01_0200:1.11
	REL-09_01_0100:1.11
	REL-09_00_0310:1.11
	REL-09_00_0300:1.11
	REL-09_00_0200:1.11
	REL-09_00_0101:1.11
	REL-09_00_0100:1.10
	REL-08_04_0200:1.10
	REL-08_04_0100:1.10
	REL-08_03_0400:1.8
	REL-08_03_0300:1.8
	REL-08_03_0200:1.8
	REL-08_03_0100:1.8
	REL-08_02_0500:1.8
	REL-08_02_0400:1.7
	REL-08_02_0300:1.7
	REL-08_02_0200:1.6
	REL-08_02_0100:1.3
	REL8_1_STABLE:1.2.0.2
	REL-08_01_0200:1.2
	REL-08_01_0102:1.2
	REL-08_01_0101:1.2
	REL-08_01_0100:1.2
	REL-08_01_0006:1.2
	REL-08_01_0005:1.2
	REL-08_01_0004:1.1;
locks; strict;
comment	@# @;


1.11
date	2010.10.13.16.24.19;	author h-saito;	state Exp;
branches;
next	1.10;

1.10
date	2009.03.25.14.50.08;	author h-saito;	state Exp;
branches;
next	1.9;

1.9
date	2008.11.23.03.12.34;	author h-saito;	state Exp;
branches;
next	1.8;

1.8
date	2007.06.11.02.21.36;	author h-saito;	state Exp;
branches;
next	1.7;

1.7
date	2006.12.14.17.46.35;	author h-saito;	state Exp;
branches;
next	1.6;

1.6
date	2006.09.15.15.03.34;	author hinoue;	state Exp;
branches;
next	1.5;

1.5
date	2006.09.14.13.21.22;	author hinoue;	state Exp;
branches;
next	1.4;

1.4
date	2006.09.05.17.49.28;	author h-saito;	state Exp;
branches;
next	1.3;

1.3
date	2006.04.28.08.12.24;	author dpage;	state Exp;
branches;
next	1.2;

1.2
date	2005.10.11.07.47.11;	author petere;	state Exp;
branches;
next	1.1;

1.1
date	2005.08.27.19.44.47;	author dpage;	state Exp;
branches;
next	;


desc
@@


1.11
log
@Add the specification of GSSPI option.
@
text
@<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
    <title>psqlODBC Configuration Options</title>
  </HEAD>

  <body bgcolor="#ffffff" text="#000000" link="#ff0000" vlink="#a00000" alink="#0000ff">
  
<h1>psqlODBC Configuration Options</h1>
  
<h2>Advanced Options 1/2 Dialog Box</h2>

<ul>
<li><b>DEFAULTS:</b> Press to this button restore the normal defaults for the 
settings described below.<br />&nbsp;</li>

<li><b>Disable Genetic Optimizer:</b> Automatically
turns off the backend genetic optimizer at connection time. This
is a convenience feature rather than having to type it in the connect settings.
This feature was added when we noticed the backend seemed to have
big problems optimizing some queries.<br />&nbsp;</li>

<li><b>KSQO (Keyset Query Optimization):</b>
<b><em>Deprecated for 7.1+ servers.</em></b> Check this option when connecting 7.0- servers and the application seems to be suffering from the following kind of queries:<br><br>

<code>select...where (a = 1 AND b = 1 AND c = 1) OR (a=1 AND b=1 AND
c = 2)...</code><br>&nbsp;</li>

<li><b>Recognize Unique Indexes:</b>
Check this option.<br />&nbsp;</li>

<li><b>Use Declare/Fetch:</b> If
true, the driver automatically uses declare cursor/fetch to handle
SELECT statements and keeps 100 rows in a cache. This is mostly a
great advantage, especially if you are only interested in reading and not
updating. It results in the driver not sucking down lots of memory
to buffer the entire result set. If set to false, cursors will not
be used and the driver will retrieve the entire result set. For very
large tables, this is very inefficient and may use up all the Windows memory/resources.
However, it may handle updates better since the tables are not kept open,
as they are when using cursors. This was the style of the old podbc32
driver. However, the behavior of the memory allocation is much improved
so even when not using cursors, performance should at least be better than
the old podbc32.<br />&nbsp;</li>

<li><b>CommLog (C:\psqlodbc_xxxx.log):</b>
Log communications to/from the backend to that file. This is good
for debugging problems.<br />&nbsp;</li>

<li><b>Parse Statements:</b> Tell the driver how to gather the information about result columns of queries. See also <em>Disallow Premature</em> and <em>ServerSide Prepare</em> options.<br>
The driver checks this option first. If disabled then it checks the Server Side Prepare option. If disabled also it checks the Disallow Premature option.<br>
If neither of them is specified the driver would execute the prepared statement prematurely when the application inquires the result columns' info.<br><br>

If this option is enabled,
the driver will parse an SQL query statement to identify the columns and
tables and gather statistics about them such as precision, nullability,
aliases, etc. It then reports this information in SQLDescribeCol,
SQLColAttributes, and SQLNumResultCols. <b>Prior to PostgreSQL 6.4,
this was the only accurate way of getting information on precision from
a query result.</b><br><br>

If the parser can not deal with a column (because it is a function
or expression, etc.), it will fallback to executing the statement which
is the old style of getting the info. The parser is fairly
sophisticated and can handle many things such as column and table aliases,
quoted identifiers, literals, joins, cross-products, etc. It can
correctly identify a function or expression column, regardless of the complexity,
but it does not attempt to determine the data type or precision of these
columns.<br />&nbsp;</li>

<li><b>Cancel as FreeStmt:</b>
<br />&nbsp;</li>

<li><b>MyLog (C:\mylog_xxxx.log):</b>
Log debug messages to that file. This is good
for debugging problems with the driver.<br />&nbsp;</li>

<li><b>Unknown Sizes: </b>This controls
what SQLDescribeCol and SQLColAttributes will return as to precision for
character data types (varchar, text, and unknown) in a result set when
the precision is unknown. <b>This was more of a workaround for pre-6.4
versions of PostgreSQL not being able to return the defined column width
of the varchar data type</b>.<br><br>

<ul>

<li><i>Maximum</i>: Always
return the maximum precision of the data type.</li>

<li><i>Dont Know</i>: Return "Don't Know"
value and let application decide.</li>

<li><i>Longest</i>: Return
the longest string length of the column of any row. Beware of this
setting when using cursors because the cache size may not be a good representation
of the longest column in the cache.</li>

<br>

<i>MS Access</i>: Seems to handle <i>Maximum</i> setting ok, as well as all the others.<br>
<i>Borland</i>: If sizes are large and lots of columns, Borland may crash badly (it doesn't seem to handle memory allocation well)
if using <i>Maximum</i> size.

</ul><br>

<li><b>Data Type Options:</b> affects how some data types are mapped:<br />&nbsp;</li>

<ul>

<li><i>Text as LongVarChar</i>:
PostgreSQL TEXT type is mapped to SQLLongVarchar, otherwise SQLVarchar.</li>

<li><i>Unknowns as LongVarChar</i>: Unknown types (arrays, etc) are mapped to SQLLongVarChar, otherwise SQLVarchar</li>

<li><i>Bools as Char</i>: Bools are mapped to SQL_CHAR, otherwise to SQL_BIT.</li>

</ul><br>

<li><b>Max Varchar</b> The maximum
precision of the Varchar and BPChar(char[x]) types. The default is 254
which actually means 255 because of the null terminator. Note, if
you set this value higher than 254, Access will not let you index on varchar
columns!<br />&nbsp;</li>

<li><b>Cache Size:</b>When using
cursors, this is the row size of the tuple cache. If not using cursors,
this is how many tuples to allocate memory for at any given time.
The default is 100 rows for either case.<br />&nbsp;</li>

<li><b>Max LongVarChar:</b> The maximum
precision of the LongVarChar type. The default is 4094 which actually
means 4095 with the null terminator. You can even specify (-4) for
this size, which is the odbc SQL_NO_TOTAL value.<br />&nbsp;</li>

<li><b>SysTable Prefixes:</b> The
additional prefixes of table names to regard as System Tables. The
driver already treats names that begin with "pg_" as system tables.
Here you can add additional ones, such as data dictionary tables (dd_).
Separate each prefix with a semicolon (;)<br />&nbsp;</li>

</ul>

<h2>Advanced Options 2/2 Dialog Box</h2>

<ul>

<li><b>ReadOnly:</b> Whether the
datasource will allow updates.<br />&nbsp;</li>

<li><b>Show System Tables:</b> The
driver will treat system tables as regular tables in SQLTables. This
is good for Access so you can see system tables.<br />&nbsp;</li>

<li><b>LF <-> CR/LF conversion:</b> Convert Unix style line endings to
DOS style.<br />&nbsp;</li>

<li><b>Updateable Cursors:</b> Enable updateable cursor emulation in the
driver.<br />&nbsp;</li>

<li><b>Bytea as LO:</b> Allow the use of bytea columns for Large Objects.
<br />&nbsp;</li>

<li><b>Row Versioning:</b> Allows
applications to detect whether data has been modified by other users while
you are attempting to update a row. It also speeds the update process
since every single column does not need to be specified in the where clause
to update a row. The driver uses the "xmin" system field of PostgreSQL
to allow for row versioning. Microsoft products seem to use this
option well. See the <a "http://psqlodbc.projects.postgresql.org/faq.html">faq</a>
for details on what you need to do to your database to allow for the row
versioning feature to be used.<br />&nbsp;</li>

<li><b>Disallow Premature:</b>
Mainly for 7.1 to 7.3 servers. <b><em>Server side prepare</em></b> is a more preferable option for 7.4+ servers.<br>
Tell the driver how to gather the information about result columns. See also <em>Parse Staements</em> and <em>Server Side Prepare</em> options.<br>
This is an option to compensate for the lack of a server's <em>Prepare</em> functionality.
For example, (Middleware) applications issue the following ODBC API calls.<br><br>

   SQLPreapare(hstmt, "select ...", ..)<br><br>

In most cases they have to know how many fields, what kind
of fields they would return and so they would issue<br><br>

   SQLNumResultCols and/or <br>
   SQLDescribeCols/SQLColAttribute etc.<br><br>

The problem is how the psqlODBC driver answers the inquiry. PostgreSQL hadn't 
provided the <em>Prepare</em> functionality until 7.4 and we couldn't ask the backend about 
it directly.

When using Disallow Premature, the driver will get the column info as follows:<br><br>
<i>
&nbsp;&nbsp;&nbsp;begin;(unless in a transaction)<br>
&nbsp;&nbsp;&nbsp;declare cursor .. for select ...<br>
&nbsp;&nbsp;&nbsp;fetch backward in ..<br>
&nbsp;&nbsp;&nbsp;close ..<br><br>
</i>
The driver gets the field info using the fetch backward's result. The fetch backward 
command returns no row but returns the field info. Though the command is expected to be returned immediately it isn't true for 7.0- servers unfortunately. 
The 7.1 or later servers <b>do</b> seem to return from the fetch backward command 
immediately.<br />&nbsp;</li>

<li><b>True is -1:</b> Represent TRUE as -1 for compatibility with some applications.
<br />&nbsp;</li>

<li><b>Server side prepare:</b> Applicable for 7.3+ servers and <em>recommended for 7.4+.</em><br />&nbsp
(7.4+) Tell the driver how to gather the information about result columns. See also <em>Parse Statement</em> and <em>Disallow Premature</em> options.<br>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp By using extended query protocol the driver replies to the inquiry correctly and effectively.<br>&nbsp 
(7.4+) By using extended query protocol the driver replies to the inquiry for the information of parameters.<br>&nbsp 
(7.3+) When using prepared statements, prepare them on the server rather than in the driver. This can give a slight performance advantage as the server<br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp doesn't need to re-parse the statement each time it is used.<br />&nbsp;</li>

<li><b>use gssapi for GSS request:</b> GSSAPI use to AUTH_REQ_GSS request from a server.(only Windows)<br />&nbsp;</li> 

<li><b>Int8 As:</b> Define what datatype to report int8 columns as.<br />&nbsp;</li>

<li><b>Extra Opts:</b> combination of the following bits.<br /><br>&nbsp;
0x1: Force the output of short-length formatted connection string. Check this bit when you use MFC CDatabase class.<br />&nbsp;
0x2: Fake MS SQL Server so that MS Access recognizes PostgreSQL's serial type as AutoNumber type.<br />&nbsp;
0x4: Reply ANSI (not Unicode) char types for the inquiries from applications. Try to check this bit when your applications don't seem to be good at handling Unicode data.<br />&nbsp;</li>

<li><b>Protocol:</b> Note that when using SSL connections this setting is ignored.<br />&nbsp;

<ul>
<li><i>6.2:</i> Forces driver to
use PostgreSQL 6.2(V0) protocol, which had different byte ordering, protocol,
and other semantics.<br />&nbsp;

<li><i>6.3</i>: Use the 6.3(V1) protocol. This is compatible
with both V1(6.3) and V2(6.4 to 7.3) backends.<br />&nbsp;</li>

<li><i>6.4+</i>: Use the 6.4(V2) protocol. This is only compatible
with 6.4 and higher backends.<br />&nbsp;</li>

<li><i>7.4+</i>: Use the 7.4(V3) protocol. This is only compatible
with 7.4 and higher backends.<br />&nbsp;</li>
</ul></li>

<li><b>Level of rollback on errors:</b> Specifies what to rollback should an
error occur.<br />&nbsp;

<ul>
<li><i>Nop(0):</i> Don't rollback anything and let the application handle the
error.<br />&nbsp;</li>

<li><i>Transaction(1):</i> Rollback the entire transaction.<br />&nbsp;</li>

<li><i>Statement(2):</i> Rollback the statement.<br />&nbsp;</li>
<br>
<b>Notes in a setup: This specification is set up with a PROTOCOL option parameter.</b><br><br>
PROTOCOL=[6.2|6.3|6.4|7.4][-(0|1|2)]<br>
default value is a sentence unit (it is a transaction unit before 8.0).<br>
<br>

</ul></li>


<li><b>OID Options:</b><br />&nbsp;

<ul>
<li><i>Show Column: </i> Includes the OID
in SQLColumns. This is good for using as a unique identifier to update
records if no good key exists OR if the key has many parts, which
blows up the backend.<br />&nbsp;</li>

<li><i>Fake Index: </i> This option
fakes a unique index on OID. This is useful when there is not a real
unique index on OID and for apps which can't ask what the unique identifier
should be (i.e, Access 2.0).<br />&nbsp;</li>
</ul></li>

<li><b>Connect Settings:</b> The
driver sends these commands to the backend upon a successful connection.&nbsp;
It sends these settings AFTER it sends the driver "Connect Settings".
Use a semi-colon (;) to separate commands. This can now handle any
query, even if it returns results. The results will be thrown away
however!<br />&nbsp;</li>
</ul>

<h2>Global settings Dialog Box</h2>

<p>This dialog allows you to specify pre-connection/default logging
options</p>

<ul>

<li><b>CommLog (C:\psqlodbc_xxxx.log - Communications log):</b>
Log communications to/from the backend to that file. This is good
for debugging problems.<br />&nbsp;</li>

<li><b>MyLog (C:\mylog_xxxx.log - Detailed debug output):</b>
Log debug messages to that file. This is good
for debugging problems with the driver.<br />&nbsp;</li>

<li><b>MSDTCLog (C:\pgdtclog\mylog_xxxx.log - MSDTC debug output):</b>
Log debug messages to that file. This is good
for debugging problems with the MSDTC.<br />&nbsp;</li>

<li><b>Specification of the holder for log outputs:</b>
Adjustment of write permission.<br />&nbsp;</li>

</ul>

<h2>Manage DSN Dialog Box</h2>

<p>This dialog allows you to select which PostgreSQL ODBC driver
to use for this connection. Note that this may not work with third
party drivers.</p>

<h2>How to specify as a connection option</h2>

<p>There is a method of specifying a connection option in a keyword strings.</p>
<p>Example:VBA</p>
<ul><li><b>
myConn = "ODBC;DRIVER={PostgreSQL};" & serverConn & _
            "A0=0;A1=6.4;A2=0;A3=0;A4=0;A5=0;A6=;A7=100;A8=4096;A9=0;" & _
            "B0=254;B1=8190;B2=0;B3=0;B4=1;B5=1;B6=0;B7=1;B8=0;B9=1;" & _
            "C0=0;C1=0;C2=dd_"
</b></li>
</ul>
<p>Please refer to a <a href="config-opt.html">keyword list</a> for details. </p>

</body>
</html>
@


1.10
log
@some changes.
@
text
@d213 2
@


1.9
log
@The specification method of the ROLLBACK option is added.
Suggestion of Andrus-san.
@
text
@d293 7
@


1.8
log
@Add the How to specify as a connection option.
@
text
@d241 1
a241 1
<li><i>Nop:</i> Don't rollback anything and let the application handle the
d244 1
a244 1
<li><i>Transaction:</i> Rollback the entire transaction.<br />&nbsp;</li>
d246 6
a251 1
<li><i>Statement:</i> Rollback the statement.<br />&nbsp;</li>
@


1.7
log
@Correction of site information.
@
text
@d296 13
@


1.6
log
@Documentation update.
@
text
@d1 1
a1 1
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
d170 1
a170 1
option well. See the <a "http://gborg.postgresql.org/project/psqlodbc/faq/faq.php">faq</a>
@


1.5
log
@Correct the handling of 0-length charcter parameters of Catalog functions.
Update a documentation.
@
text
@d1 1
a1 1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
d51 5
a55 1
<li><b>Parse Statements:</b> If enabled,
d176 1
d207 5
a211 4
<li><b>Server side prepare:</b> Available for 7.3+ servers and <em>recommended for 7.4+.</em><br />&nbsp
(7.4+) By using extended query protocol the driver replies to the inquiry for the information of columns or parameters correctly and effectively.<br>&nbsp 
(7.3+) When using prepared statements, prepare them on the server rather than in the driver. This can give a slight performance advantage as the server<br>&nbsp
doesn't need to re-parse the statement each time it is used.<br />&nbsp;</li>
@


1.4
log
@Addition of specification.
(08.02.0101) Inoue-san. some bugs - correction.
@
text
@d25 1
a25 3
This feature helps certain queries run in the backend without crashing.
Some applications, specifically the MS Jet Database Engine, use "keyset"
queries of the form:<br><br>
d28 1
a28 4
c = 2)...</code><br><br>

These types of queries will most likely crash the backend without the KSQO
feature.<br />&nbsp;</li>
d31 1
a31 6
This controls what SQLStatistics() will return about unique indexes.
By default it is set to false. This setting allows Access 95 and
97 to ask the user at link time what the index should be. This is
meant as a workaround until the backend canonifier can handle the Microsoft
Access queries better. For some applications (i.e., Access 2.0), you must
set this option to update any tables.<br />&nbsp;</li>
d171 3
a173 2
Disallow Premature is an option to compensate for the lack of a server's functionality.
For example (Middleware) applications issue the following ODBC API calls.<br><br>
d183 2
a184 2
The problem is how the psqlODBC driver answers the inquiry. PostgreSQL hasn't 
provided the Prepare functionality yet and we couldn't ask the backend about 
d195 1
a195 2
command returns no row but returns the field info. I also expected the the fetch
backward command returns immediately but unfortunately it isn't always true. 
d202 4
a205 4
<li><b>Server side prepare:</b> When using prepared statements, prepare them on the 
server rather than in the driver. This can give a slight performance advantage as the
server doesn't need to re-parse the statement each time it is used.
<br />&nbsp;</li>
d209 4
a212 4
<li><b>Extra Opt:</b> extra options.<br />&nbsp;</li>
0x1: Abbreviation option of connection.<br />&nbsp;</li>
0x2: Fake MS SQL Server.<br />&nbsp;</li>
0x4: BDE Environment.<br />&nbsp;</li>
d214 1
a214 1
<li><b>Protocol:</b> <br />&nbsp;
d218 1
a218 1
use PostgreSQL 6.2 protocol, which had different byte ordering, protocol,
d221 2
a222 2
<li><i>6.3</i>: Use the 6.3 protocol. This is compatible
with both 6.3 and 6.4 backends.<br />&nbsp;</li>
d224 1
a224 1
<li><i>6.4+</i>: Use the 6.4 protocol. This is only compatible
d227 1
a227 1
<li><i>7.4+</i>: Use the 7.4 protocol. This is only compatible
d235 1
a235 1
<li><i>Nop:</i> Don't rollback anything (let the application handle the
@


1.3
log
@Update the configuration notes to match reality a little better.
@
text
@d219 5
@


1.2
log
@Fix spelling of PostgreSQL.
@
text
@d1 296
a296 241
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
    <title>psqlODBC Configuration Options</title>
  </HEAD>

  <body bgcolor="#ffffff" text="#000000" link="#ff0000" vlink="#a00000" alink="#0000ff">
  
<h1>psqlODBC Configuration Options</h1>
  
<h2>Advanced Options (Driver) Dialog Box</h2>

<ul>
<li><b>DEFAULTS:</b> Press to this button restore the normal defaults for the 
settings described below.<br />&nbsp;</li>

<li><b>Disable Genetic Optimizer:</b> Automatically
turns off the backend genetic optimizer at connection time. This
is a convenience feature rather than having to type it in the connect settings.
This feature was added when we noticed the backend seemed to have
big problems optimizing some queries.<br />&nbsp;</li>

<li><b>KSQO (Keyset Query Optimization):</b>
This feature helps certain queries run in the backend without crashing.
Some applications, specifically the MS Jet Database Engine, use "keyset"
queries of the form:<br><br>

<code>select...where (a = 1 AND b = 1 AND c = 1) OR (a=1 AND b=1 AND
c = 2)...</code><br><br>

These types of queries will most likely crash the backend without the KSQO
feature.<br />&nbsp;</li>

<li><b>CommLog (C:\psqlodbc.log):</b>
Log communications to/from the backend to that file. This is good
for debugging problems.<br />&nbsp;</li>

<li><b>Recognize Unique Indexes:</b>
This controls what SQLStatistics() will return about unique indexes.
By default it is set to false. This setting allows Access 95 and
97 to ask the user at link time what the index should be. This is
meant as a workaround until the backend canonifier can handle the Microsoft
Access queries better. For some applications (i.e., Access 2.0), you must
set this option to update any tables.<br />&nbsp;</li>

<li><b>ReadOnly (default):</b> New
datasources will inherit the state of this box for the datasource readonly
attribute.<br />&nbsp;</li>

<li><b>Use Declare/Fetch:</b> If
true, the driver automatically uses declare cursor/fetch to handle
SELECT statements and keeps 100 rows in a cache. This is mostly a
great advantage, especially if you are only interested in reading and not
updating. It results in the driver not sucking down lots of memory
to buffer the entire result set. If set to false, cursors will not
be used and the driver will retrieve the entire result set. For very
large tables, this is very inefficient and may use up all the Windows memory/resources.
However, it may handle updates better since the tables are not kept open,
as they are when using cursors. This was the style of the old podbc32
driver. However, the behavior of the memory allocation is much improved
so even when not using cursors, performance should at least be better than
the old podbc32.<br />&nbsp;</li>

<li><b>Parse Statements:</b> If enabled,
the driver will parse an SQL query statement to identify the columns and
tables and gather statistics about them such as precision, nullability,
aliases, etc. It then reports this information in SQLDescribeCol,
SQLColAttributes, and SQLNumResultCols. <b>Prior to PostgreSQL 6.4,
this was the only accurate way of getting information on precision from
a query result.</b><br><br>

If the parser can not deal with a column (because it is a function
or expression, etc.), it will fallback to executing the statement which
is the old style of getting the info. The parser is fairly
sophisticated and can handle many things such as column and table aliases,
quoted identifiers, literals, joins, cross-products, etc. It can
correctly identify a function or expression column, regardless of the complexity,
but it does not attempt to determine the data type or precision of these
columns.<br />&nbsp;</li>

<li><b>Unknown Sizes: </b>This controls
what SQLDescribeCol and SQLColAttributes will return as to precision for
character data types (varchar, text, and unknown) in a result set when
the precision is unknown. <b>This was more of a workaround for pre-6.4
versions of PostgreSQL not being able to return the defined column width
of the varchar data type</b>.<br><br>

<ul>

<li><i>Maximum</i>: Always
return the maximum precision of the data type.</li>

<li><i>Dont Know</i>: Return "Don't Know"
value and let application decide.</li>

<li><i>Longest</i>: Return
the longest string length of the column of any row. Beware of this
setting when using cursors because the cache size may not be a good representation
of the longest column in the cache.</li>

<br>

<i>MS Access</i>: Seems to handle <i>Maximum</i> setting ok, as well as all the others.<br>
<i>Borland</i>: If sizes are large and lots of columns, Borland may crash badly (it doesn't seem to handle memory allocation well)
if using <i>Maximum</i> size.

</ul><br>

<li><b>Data Type Options:</b> affects how some data types are mapped:<br />&nbsp;</li>

<ul>

<li><i>Text as LongVarChar</i>:
PostgreSQL TEXT type is mapped to SQLLongVarchar, otherwise SQLVarchar.</li>

<li><i>Unknowns as LongVarChar</i>: Unknown types (arrays, etc) are mapped to SQLLongVarChar, otherwise SQLVarchar</li>

<li><i>Bools as Char</i>: Bools are mapped to SQL_CHAR, otherwise to SQL_BIT.</li>

</ul><br>

<li><b>Cache Size:</b>When using
cursors, this is the row size of the tuple cache. If not using cursors,
this is how many tuples to allocate memory for at any given time.
The default is 100 rows for either case.<br />&nbsp;</li>

<li><b>Max Varchar</b> The maximum
precision of the Varchar and BPChar(char[x]) types. The default is 254
which actually means 255 because of the null terminator. Note, if
you set this value higher than 254, Access will not let you index on varchar
columns!<br />&nbsp;</li>

<li><b>Max LongVarChar:</b> The maximum
precision of the LongVarChar type. The default is 4094 which actually
means 4095 with the null terminator. You can even specify (-4) for
this size, which is the odbc SQL_NO_TOTAL value.<br />&nbsp;</li>

<li><b>SysTable Prefixes:</b> The
additional prefixes of table names to regard as System Tables. The
driver already treats names that begin with "pg_" as system tables.
Here you can add additional ones, such as data dictionary tables (dd_).
Separate each prefix with a semicolon (;)<br />&nbsp;</li>

<li><b>Connect Settings: </b>These commands
will be sent to the backend upon a successful connection. Use
a semi-colon (;) to separate commands. This can now handle any query,
even if it returns results. The results will be thrown away however!<br />&nbsp;</li>
</ul>

<h2>Advanced Options (DataSource or Connection) Dialog Box</h2>

<ul>

<li><b>ReadOnly:</b> Whether the
datasource will allow updates. For new datsources, the default value
comes from the Advanced Options (Driver) dialog box.<br />&nbsp;</li>

<li><b>Connect Settings:</b> The
driver sends these commands to the backend upon a successful connection.&nbsp;
It sends these settings AFTER it sends the driver "Connect Settings".
Use a semi-colon (;) to separate commands. This can now handle any
query, even if it returns results. The results will be thrown away
however!<br />&nbsp;</li>

<li><b>Row Versioning:</b> Allows
applications to detect whether data has been modified by other users while
you are attempting to update a row. It also speeds the update process
since every single column does not need to be specified in the where clause
to update a row. The driver uses the "xmin" system field of PostgreSQL
to allow for row versioning. Microsoft products seem to use this
option well. See the <a "http://gborg.postgresql.org/project/psqlodbc/faq/faq.php">faq</a>
for details on what you need to do to your database to allow for the row
versioning feature to be used.<br />&nbsp;</li>

<li><b>Disallow Premature:</b>
Disallow Premature is an option to compensate for the lack of a server's functionality.
For example (Middleware) applications issue the following ODBC API calls.<br><br>

   SQLPreapare(hstmt, "select ...", ..)<br><br>

In most cases they have to know how many fields, what kind
of fields they would return and so they would issue<br><br>

   SQLNumResultCols and/or <br>
   SQLDescribeCols/SQLColAttribute etc.<br><br>

The problem is how the psqlODBC driver answers the inquiry. PostgreSQL hasn't 
provided the Prepare functionality yet and we couldn't ask the backend about 
it directly.

When using Disallow Premature, the driver will get the column info as follows:<br><br>
<i>
&nbsp;&nbsp;&nbsp;begin;(unless in a transaction)<br>
&nbsp;&nbsp;&nbsp;declare cursor .. for select ...<br>
&nbsp;&nbsp;&nbsp;fetch backward in ..<br>
&nbsp;&nbsp;&nbsp;close ..<br><br>
</i>
The driver gets the field info using the fetch backward's result. The fetch backward 
command returns no row but returns the field info. I also expected the the fetch
backward command returns immediately but unfortunately it isn't always true. 
The 7.1 or later servers <b>do</b> seem to return from the fetch backward command 
immediately.<br />&nbsp;</li>

<li><b>Show System Tables:</b> The
driver will treat system tables as regular tables in SQLTables. This
is good for Access so you can see system tables.<br />&nbsp;</li>

<li><b>OID Options:</b><br />&nbsp;</li>

<ul>
<li><i>Show Column</i> - Includes the OID
in SQLColumns. This is good for using as a unique identifier to update
records if no good key exists OR if the key has many parts, which
blows up the backend.<br />&nbsp;</li>

<li><i>Fake Index</i> - This option
fakes a unique index on OID. This is useful when there is not a real
unique index on OID and for apps which can't ask what the unique identifier
should be (i.e, Access 2.0).</li><br>

</ul></li><br>

<li><b>Protocol</b> (note that the protocol option has no effect from version 08.01.0001 onwards):<br />&nbsp;</li>

<ul>
<li><b>6.2:</b> Forces driver to
use PostgreSQL 6.2 protocol, which had different byte ordering, protocol,
and other semantics.<br />&nbsp;</li>

<li><b>6.3</b>: Use the 6.3 protocol. This is compatible
with both 6.3 and 6.4 backends.<br />&nbsp;</li>

<li><b>6.4</b>: Use the 6.4 protocol. This is only compatible
with 6.4 backends.<br />&nbsp;</li>

</ul>
</ul>

</body>
</html>
@


1.1
log
@Move docs into the source tree.
@
text
@d69 1
a69 1
SQLColAttributes, and SQLNumResultCols. <b>Prior to Postgres 6.4,
d86 1
a86 1
versions of Postgres not being able to return the defined column width
d115 1
a115 1
Postgres TEXT type is mapped to SQLLongVarchar, otherwise SQLVarchar.</li>
d170 1
a170 1
to update a row. The driver uses the "xmin" system field of Postgres
d228 1
a228 1
use Postgres 6.2 protocol, which had different byte ordering, protocol,
d241 1
a241 1
</html>@

