Index: /trunk/README.OS2
===================================================================
--- /trunk/README.OS2	(revision 802)
+++ /trunk/README.OS2	(revision 803)
@@ -82,4 +82,19 @@
     Note that you will also need the above OpenSSL libraries and pthread.lib to
     be able to use this MySQL build.
+
+  - PostgersSQL 9.0.1 or later to support the PostgresSQL Qt plugin. The
+    PostgresSQL libraries are available at:
+
+      http://download.smedley.info/postgresql-9.0.1-os2-20101012.zip
+
+    Note that you will also need libc064x.dll for this PostgresSQL build and a
+    patched PostgresSQL DLL that fixes one critical bug (this will not be
+    necessary for the next PostgresSQL build as it will incorporate the fix):
+
+      http://download.smedley.info/libc064x.zip
+      http://smedley.info/libpq.zip
+
+    Note that you will also need the above OpenSSL libraries and pthread.lib to
+    be able to use this PostgresSQL build.
 
 
@@ -181,4 +196,16 @@
       set MYSQL_INCLUDEPATH=<path_to_MySQL>\include'
       set MYSQL_LIBS=-L<path_to_MySQL>\lib -lmysqlclient_r -L<path_to_OpenSSL>\lib -llibssl -llibcrypto -L<path_to_pthread> -lpthread
+
+    Also add MySQL DLLs to BEGINLIBPATH if they are not already there as shown
+    above.
+
+  - Unzip the PostgresSQL archive to some directory and set the following
+    environment variables to tell the Qt configure script the library location:
+
+      set PSQL_INCLUDEPATH=<path_to_PostgresSQL>\include'
+      set PSQL_LIBS=-L<path_to_PostgresSQL>\lib -llibpq -L<path_to_OpenSSL>\lib -llibssl -llibcrypto -L<path_to_pthread> -lpthread
+
+    Also add PostgresSQL DLLs to BEGINLIBPATH if they are not already there as
+    shown above.
 
 
Index: /trunk/configure.cmd
===================================================================
--- /trunk/configure.cmd	(revision 802)
+++ /trunk/configure.cmd	(revision 803)
@@ -943,4 +943,27 @@
                 end
             end
+            when (drv == "psql") then do
+                if (G.CFG_SQL_psql \== "no") then do
+                    /* detect PostgresSQL libraries */
+                    G.PSQL_INCLUDEPATH = GetEnv('PSQL_INCLUDEPATH')
+                    G.PSQL_LIBS = GetEnv('PSQL_LIBS')
+                    if (G.PSQL_INCLUDEPATH \== '' & G.PSQL_LIBS \== '')  then do
+                        call SayVerbose 'PostgresSQL include path : 'G.PSQL_INCLUDEPATH
+                        call SayVerbose 'PostgresSQL libraries    : 'G.PSQL_LIBS
+                        call SayVerbose
+                        /* qt sources for some reason include mysql headers directly, so
+                         * add a prefix here to fix that */
+                        if (G.CFG_SQL_psql == "auto") then
+                            G.CFG_SQL_psql = "plugin"
+                    end
+                    else do
+                        call SayVerbose,
+'Warning: PostgresSQL libraries are not specified, PostgresSQL plugin is disabled.'G.EOL||,
+'Use PSQL_INCLUDEPATH and PSQL_LIBS environment variables to specify'G.EOL||,
+'the location of the libraries.'G.EOL||G.EOL
+                        G.CFG_SQL_psql = 'no'
+                    end
+                end
+            end
             when (drv == "sqlite") then do
                 if (G.CFG_SQL_sqlite \== "no") then do
@@ -1742,4 +1765,9 @@
     if (G.MYSQL_LIBS \== "") then
         call lineout qmake_cache_new, 'MYSQL_LIBS = 'G.MYSQL_LIBS
+
+    if (G.PSQL_INCLUDEPATH \== "") then
+        call lineout qmake_cache_new, 'PSQL_INCLUDEPATH = 'G.PSQL_INCLUDEPATH
+    if (G.PSQL_LIBS \== "") then
+        call lineout qmake_cache_new, 'PSQL_LIBS = 'G.PSQL_LIBS
 
     if (G.QT_EDITION \== "QT_EDITION_OPENSOURCE") then
Index: /trunk/src/plugins/sqldrivers/psql/psql.pro
===================================================================
--- /trunk/src/plugins/sqldrivers/psql/psql.pro	(revision 802)
+++ /trunk/src/plugins/sqldrivers/psql/psql.pro	(revision 803)
@@ -1,3 +1,4 @@
 TARGET	 = qsqlpsql
+os2:TARGET_SHORT = qpsql
 
 HEADERS		= ../../../sql/drivers/psql/qsql_psql.h
@@ -19,3 +20,8 @@
 }
 
+os2 {
+    INCLUDEPATH *= $$PSQL_INCLUDEPATH
+    LIBS        *= $$PSQL_LIBS    
+}
+
 include(../qsqldriverbase.pri)
