faq.html

来自「postgresql-odbc,跨平台应用」· HTML 代码 · 共 588 行 · 第 1/2 页

HTML
588
字号
<!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 FAQ</title>  </head>  <body bgcolor="#ffffff" text="#000000" link="#ff0000" vlink="#a00000" alink="#0000ff">      <h1>psqlODBC FAQ</h1>    <p>Last updated: $Date: 2006/12/14 17:46:35 $</p>    <P>Current maintainer: Dave Page (<a href="mailto:dpage@postgresql.org">dpage@postgresql.org</a>)</p>    <p>The most recent version of this document can be viewed at <a href=    "http://psqlodbc.projects.postgresql.org/faq.html">http://psqlodbc.projects.postgresql.org/faq.html</a>.</p>    <hr>    <h2>1) General</h2>    <a href="#1.1">1.1</a>) How do I submit an idea for a new feature or even a patch?<br>    <a href="#1.2">1.2</a>) Do I even need to compile the driver to use it?<br>    <a href="#1.3">1.3</a>) How do I install the driver?<br>    <a href="#1.4">1.4</a>) What operating systems will the driver run on?<br>    <a href="#1.5">1.5</a>) I've seen other PostgreSQL ODBC drivers out there. Which one is the right one?<br>    <a href="#1.6">1.6</a>) How do I report a bug or other problems?<br>        <h2>2) Basics</h2>    <a href="#2.1">2.1</a>) How do I setup a datasource?<br>    <a href="#2.2">2.2</a>) What's the difference between a File DSN, System DSN, and User DSN?<br>    <a href="#2.3">2.3</a>) How do I access more advanced driver and/or datasource options?<br>    <a href="#2.4">2.4</a>) Where can I discover more information about ODBC errors?<br>    <a href="#2.5">2.5</a>) There are 2 drivers installed - which should I use?<br>    <h2>3) Connections</h2>    <a href="#3.1">3.1</a>) Why do I get a message like "Failed to authenticate client as Postgres user using unknown authentication type:be_recvauth: unrecognized message type: 65536" when I try to connect to a datasource?<br>    <a href="#3.2">3.2</a>) Why do I get a message like "User authentication failed"?<br>    <a href="#3.3">3.3</a>) What do I need to do to establish a connection to a database?<br>    <a href="#3.4">3.4</a>) Does psqlODBC support encrypted login for connections?<br>        <h2>4) Advanced</h2>    <a href="#4.1">4.1</a>) Why do characters with umlauts or accents, or other non-ASCII characters show up in some applications as '?'<br>    <a href="#4.2">4.2</a>) What data types does the driver support?<br>    <a href="#4.3">4.3</a>) How do I use the row versioning -OR- why do I get a message about no operator for xid and int4?<br>    <a href="#4.4">4.4</a>) Can I use large objects or OLE?<br>    <a href="#4.5">4.5</a>) Why does the PostgreSQL backend complain about running out of memory when some I browse tables with primary keys?<br>    <a href="#4.6">4.6</a>) How do I get my application to recognize primary keys?<br>            <h2>5) Borland Applications</h2>    <a href="#5.1">5.1</a>) What driver/datasource options work well with Borland products?<br>    <a href="#5.2">5.2</a>) # Why do varchar/char datatypes not appear with the correct precision in Borland DBExplorer -OR- why do all varchar/char precisions appear as 128?<br>            <h2>6) Microsoft Applications</h2>    <a href="#6.1">6.1</a>) Why don't int4 based aggregates seem to work?<br>    <a href="#6.2">6.2</a>) Why does Access force me specify the Data Source each time I run my SQL Pass-Thru query?<br>    <a href="#6.3">6.3</a>) Why does MS Access sometimes complain about a GROUP BY or ORDER BY not being in the target list?<br>    <a href="#6.4">6.4</a>) Why do I get 'Write Conflict - This record has been changed by another user since you started editing it' in Access 2000 and above?<br>    <a href="#6.5">6.5</a>) With MS Access, why can't I index on text fields -OR- why do I get "Invalid field definition 'field'" in definition of index or relationship?<br>    <a href="#6.6">6.6</a>) With MS Access, why can't I GROUP BY,  ORDER BY, or even select WHERE, on columns which are of type "text"?<br>    <a href="#6.7">6.7</a>) With MS Access, why do I see #Deleted# in rows after some operations?<br>    <h2>1) General</h2>     <h3><a name="1.1">1.1</a>) How do I submit an idea for a new feature or even a patch?</h3>    <p>    You can send mail to <a href="pgsql-odbc@postgresql.org">pgsql-odbc@postgresql.org</a>.    </p>    <h3><a name="1.2">1.2</a>) Do I even need to compile the driver to use it?</h3>    <p>    Probably not. If you are using Windows, all you really need to do is download and run     the Full distribution.    </p>    <h3><a name="1.3">1.3</a>) How do I install the driver?</h3>    <p>    The easiest way to install the driver is to get the Full distribution. Just download,     unzip and run the setup program program. The installation is a standard Windows     Installer package that will guide you through the process. For future upgrades,     the MSI distribution can be used. This is considerably smaller as it does not     include the Windows Installer redistributable which you only need install once.     The second option is to compile the driver yourself. If you are using this     driver on a unix platform, this is currently your only option.    </p>        <h3><a name="1.4">1.4</a>) What operating systems will the driver run on?</h3>    <p>    The psqlODBC executable is written and compiled to run on 32 bit Wintel platform.     This includes Windows 95, 98, ME, NT, 2000 and XP. 16 bit applications are capable     of using the 32 bit driver but only on these platforms.    </p>    <p>    We do not distribute binaries for Unix. The source code, however has been ported     to compile under Unix. There are two driver managers available for Unix,     <a href="http://www.unixodbc.org/">UnixODBC</a> and <a href="http://www.iodbc.org/">iODBC</a>.    </p>        <h3><a name="1.5">1.5</a>) I've seen other PostgreSQL ODBC drivers out there. Which one is the right one?</h3>    <p>    This one! This is <i>the</i> official PostgreSQL ODBC driver.    </p>        <h3><a name="1.6">1.6</a>) How do I report a bug or other problems?</h3>    <p>    You can send mail to pgsql-odbc@postgresql.org When you do, however, you should attach the following:    </p>    <ul>      <li>your ODBC driver version</li>      <li>your PostgreSQL database version</li>      <li>any error messages you saw on the screen</li>      <li>the debug log (mylog_????.log) file (you will have to enable the mylog driver option)</li>    </ul>    <p>    Before posting however, please ensure you are running the latest version of psqlODBC.    </p>            <h2>2) Basics</h2>    <h3><a name="2.1">2.1</a>) How do I setup a datasource?</h3>    <p>    For Windows, use the ODBC Administrator in Control Panel. Here you can add, modify, or delete data sources.    </p>    <h3><a name="2.2">2.2</a>) What's the difference between a File DSN, System DSN, and User DSN?</h3>    <p>    System DSN's and User DSN's differ only in who can access them on the system.     A File DSN, however, is not really a datasource. It is a file that contains all     the connection parameters used to connect directly to an ODBC driver.    </p>        <h3><a name="2.3">2.3</a>) How do I access more advanced driver and/or datasource options?</h3>    <p>    First, select your favorite datasource to configure. Then in the "PostgreSQL Driver Setup" dialog,     select under "Options (Advanced)" either the Driver button or Datasource button. This will bring     up another dialog box which contains options you can configure. Refer to the Configuration Help for    information on all these options.    </p>        <h3><a name="2.4">2.4</a>) Where can I discover more information about ODBC errors?</h3>    <p>    The ODBC driver has an option to log all direct communication (queries, updates, etc.) with     the backend as well as error messages and notices in the commlog file. In addition, it now     also logs any ODBC connection and statement errors in this file with detailed information.     This is good for applications that give misleading, little, or no descriptive information     when something goes wrong (VisData is a good example).    </p>        <h3><a name="2.5">2.5</a>) There are 2 drivers installed - which should I use?</h3>    <p>    <b>PostgreSQL Unicode</b> is a Unicode enabled driver that will work well with modern versions of    applications such as Microsoft Access, with character from a huge range of languages. You should    use this driver with PostgreSQL databases encoded as 'UNICODE' (more precisely known as 'UTF-8' in    PostgreSQL).    </p>    <p>    <b>PostgreSQL ANSI</b> is an ANSI driver which is also able to handle some multibyte character sets    such as EUC_JP, BIG5 and Shift-JIS. This driver should also be used with databases encoded using    any of the LATIN charactersets.    </p>    <p>    Note that some applications (notably Borland BDE) do not work properly with Unicode ODBC drivers.    In this case, you must use the ANSI driver.    </p>    <h2>3) Connections</h2>        <h3><a name="3.1">3.1</a>) Why do I get a message like "Failed to authenticate client as Postgres user using unknown authentication type:be_recvauth: unrecognized message type: 65536" when I try to connect to a datasource?</h3>    <p>    This message comes from the PostgreSQL backend, most likely when there is a protocol     mismatch between the ODBC driver and the backend. For example, if you are using PostgreSQL    6.2 as the backend and try to use the ODBC driver without correctly setting the protocol,     this error will occur. You must check the "6.2 protocol" advanced datasource option in     the ODBC driver configuration dialog.    </p>    <p>    <b>Note:</b> If you're still running 6.x these days, you really, really, really should upgrade to 8.x as soon as possible!!    </p>    <h3><a name="3.2">3.2</a>) Why do I get a message like "User authentication failed"?</h3>    <p>    Verify that the database you are trying to connect to exists and is accessible by you.     Also, see the above question in regards to user name and password authentication.    </p>    <h3><a name="3.3">3.3</a>) What do I need to do to establish a connection to a database?</h3>    <p>    ODBC Connection Checklist:    </p>    <ul>      <li>ODBC Driver Data Source Checks        <ul>          <li>Valid and resolvable hostname.</li>          <li>Valid port number (default is 5432).</li>          <li>Valid and existing database name.</li>          <li>Valid user name.</li>          <li>Valid password for the specified user (required if pg_hba.config is set to password authenticate your client).</li>        </ul>      <br>&nbsp;</li>      <li>PostgreSQL Server Checks        <ul>          <li>Postmaster must be running.</li>          <li>Postmaster must run with the -i option , or tcpip=true in postgresql.conf to allow remote connections.</li>          <li>The pg_hba.conf file in /data directory must be configured to allow your remote host to connect.</li>        </ul>      </li>    </ul>        <h3><a name="3.4">3.4</a>) Does psqlODBC support encrypted login for connections?</h3>    <p>    Yes. psqlODBC supports "md5" encrypted logins, but not "crypt" logins. Keep     in mind that after login, ODBC sends all queries in plain text, so all you're     protecting is your password. Also, support for md5 logins was added in late 2001,     so if you have an older version of psqlODBC you may need to update it.    </p>    <p>    <b>Note:</b> As of version 08.01.002, psqlODBC now supports SSL encrypted connections.    </p>    <h2>4) Advanced</h2>    <h3><a name="4.1">4.1</a>) Why do characters with umlauts or accents, or other non-ASCII characters show up in some applications as '?'</h3>    <p>    You are probably using the <b>PostgreSQL Unicode</b> driver with non-Unicode,    8 bit data - for example, from one of the LATIN encodings. You should either     use the <b>PostgreSQL ANSI</b> driver, or move your data to a Unicode database.    </p>        <h3><a name="4.2">4.2</a>) What data types does the driver support?</h3>    <p>    The driver provides full support for all PostgreSQL standard data types.     These are: bool, int2, int4, int8, float4, float8, date, time, abstime,     datetime, timestamp, char, varchar, and text.    </p>    <p>    There is partial support for all other data types. Examples of these:     point, circle, box and arrays. String support only is provided for these     non-standard types. In other words, they are returned as SQL_VARCHAR and     can be displayed and updated like any other data type. The resulting     behavior will probably vary some with each application and data type.    </p>    <p>    In the case of int4[] and MS Access 97 it does an effective job. The array     can be displayed and updated cleanly. Arithmetic is a little tricky. MS Access     complains about "t.a[1]" in the query builder. It does not like the syntax and     never sends it to the backend. The work around is to choose the SQL Pass-thru     option. This will allow you to build expressions like "t.a[0] * t.a[1]". The     hassle is that every time you run the query in Access 97 it prompts you with     a database connection dialog.    </p>    <p>    MS Excel in combination w/ MS Query may provide a better solution. It passes     every query through. I try to stay away from the more exotic types if I know I     am going to expose them to the public.    </p>        <h3><a name="4.3">4.3</a>) How do I use the row versioning -OR- why do I get a message about no operator for xid and int4?</h3>    <p>    Some of the operators are missing in some releases of PostgreSQL (anyone remember     which?) so in order to use row versioning, you must overload the int4eq function     for use with the xid type. Also, you need to create an operator to compare xid to     int4. You must do this for each database you want to use this feature on. This will     probably not be necessary in PostgreSQL 6.4 since it will be added. Here are the details:    </p>    <pre>    create function int4eq(xid,int4)        returns bool        as ''        language 'internal';    create operator = (        leftarg=xid,        rightarg=int4,        procedure=int4eq,        commutator='=',        negator='<>',        restrict=eqsel,        join=eqjoinsel    );    </pre>        <h3><a name="4.4">4.4</a>) Can I use large objects or OLE?</h3>    <p>    Large objects are mapped to LONGVARBINARY in the driver to allow storing things like OLE     objects in Microsoft Access. Multiple SQLPutData and SQLGetData calls are usually used to     send and retrieve these objects. The driver creates a new large object and simply inserts     its 'identifier' into the respective table. However, since PostgreSQL uses an 'Oid' to identify     a Large Object, it is necessary to create a new PostgreSQL type to be able to discriminate     between an ordinary Oid and a Large Object Oid. Until this new type becomes an official     part of PostgreSQL, it must be added into the desired database and looked up for each connection. 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?