noreply | 5 Aug 2010 20:20

[ psqlodbc-Bugs-1010862 ] Will not run on Windows 2000 and older, missing symbols

Bugs item #1010862, was opened at 2010-08-05 13:20
You can respond by visiting: 
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1010862&group_id=1000125

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Darrell Walisser (mediak)
Assigned to: Nobody (None)
Summary: Will not run on Windows 2000 and older, missing symbols

Initial Comment:
psqlODBC version: 8.04 0200

Attempting to use the driver under Windows 2000 in ODBC driver manager yields this:

"The setup routines for the PostgreSQL ANSI ODBC driver could not be loaded due to system error code 127"

then another dialog:

"Driver's ConfigDSN, ConfigDriver, or ConfigTranslator failed"
"Could not load the setup or translator library"

I turns out that the psqlodbc*.dll is missing these symbols in WS_32.dll: freeaddrinfo, getaddrinfo, getnameinfo

This article explains why they are missing, these were added in XP but there is a trick to make them work in
earlier versions. Basically this could be fixed with a recompile. I could not compile with VS6 but I am
having a go with Visual Studio Express 2008 (I usually use mingw for all Windows development so this may not work).
(Continue reading)

noreply | 5 Aug 2010 20:43

[ psqlodbc-Bugs-1010862 ] Will not run on Windows 2000 and older, missing symbols

Bugs item #1010862, was opened at 2010-08-05 13:20
You can respond by visiting: 
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1010862&group_id=1000125

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Darrell Walisser (mediak)
Assigned to: Nobody (None)
Summary: Will not run on Windows 2000 and older, missing symbols

Initial Comment:
psqlODBC version: 8.04 0200

Attempting to use the driver under Windows 2000 in ODBC driver manager yields this:

"The setup routines for the PostgreSQL ANSI ODBC driver could not be loaded due to system error code 127"

then another dialog:

"Driver's ConfigDSN, ConfigDriver, or ConfigTranslator failed"
"Could not load the setup or translator library"

I turns out that the psqlodbc*.dll is missing these symbols in WS_32.dll: freeaddrinfo, getaddrinfo, getnameinfo

This article explains why they are missing, these were added in XP but there is a trick to make them work in
earlier versions. Basically this could be fixed with a recompile. I could not compile with VS6 but I am
having a go with Visual Studio Express 2008 (I usually use mingw for all Windows development so this may not work).
(Continue reading)

noreply | 5 Aug 2010 23:39

[ psqlodbc-Bugs-1010864 ] CODBCFieldInfo field type (m_nSQLType) is incorrect

Bugs item #1010864, was opened at 2010-08-05 14:39
You can respond by visiting: 
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1010864&group_id=1000125

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Mark Richardson (markmapo)
Assigned to: Nobody (None)
Summary: CODBCFieldInfo field type (m_nSQLType) is incorrect

Initial Comment:
Using the CRecordset.GetODBCFieldInfo() function to retrieve a CODBCFieldInfo about the field give
incorrect values for the types.  I only checked a couple types agains an access database...

db_table_type postgres_value access_value
int 4 5
double 6 8

What are the values supposed to be? Far as I can tell they are the values which come from "atldbcli.h" &
"oledb.h" - but these don't match with the access values either (poor documentation on what these values
are supposed to be from MS about ODBC - suprise?no)

Also, the CRecordSet.GetTableName() is unset (so is the access database value).  I don't like the way that a
table name is assigned to an entire CRecordset, as each field MAY be from a different table. I prefer the way
postgres has a table name for each field - but we're stuck using the ODBC interface.

Thanks guys for all the great work!
(Continue reading)

Calvin | 9 Aug 2010 19:13
Picon
Favicon

Moving data from SQL Server to Postgres via VFP ODBC Driver

I am attempting to move data from a SQL Server 2008 database to Postgres v8.4. I
am using Visual Fox Pro as an intermediate step in this process. I open a
connection to the SQL tables using the ODBC driver and at the same time open a
connect to the PostGres table using PostgresSQL30. The reason I am doing it this
way is I cannot seem to overcome issues concerning bit fields in SQL Server and
Booleans in Postgres. Using VFP I can do a quick and dirty conversion. However,
the problem is that when I look at the data in Postgres it converted
successfully with the exception of varying character fields which have been
padded to their maximum length. My insert statement is in the form :

Insert into PostgresTableName Values(m.field1, trim(m.field2....)

The m. systax is because I am using memory variables in VFP. The data contained
in the m.fields has all be trimmed if it is character type. 

Is there any way to keep varying character fields from being padded out to their
maximum length.

Thanks!

--

-- 
Sent via pgsql-odbc mailing list (pgsql-odbc <at> postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc

Richard Broersma | 9 Aug 2010 19:59
Picon

Re: Moving data from SQL Server to Postgres via VFP ODBC Driver

On Mon, Aug 9, 2010 at 10:13 AM, Calvin <calvinsmith266 <at> hotmail.com> wrote:
> I am attempting to move data from a SQL Server 2008 database to Postgres v8.4. I
> am using Visual Fox Pro as an intermediate step in this process. I open a
> connection to the SQL tables using the ODBC driver and at the same time open a
> connect to the PostGres table using PostgresSQL30. The reason I am doing it this
> way is I cannot seem to overcome issues concerning bit fields in SQL Server and
> Booleans in Postgres. Using VFP I can do a quick and dirty conversion. However,
> the problem is that when I look at the data in Postgres it converted
> successfully with the exception of varying character fields which have been
> padded to their maximum length. My insert statement is in the form :

It would seem that the string padding is taking place on the
SQL-Server side.  Is there anyway to verify if it is treating the
varchar type as char in its odbc driver?

If you need to you can put the trimming operation in before insert
trigger functions on these columns. But I expect this solution is not
optimal.

-- 
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

--

-- 
Sent via pgsql-odbc mailing list (pgsql-odbc <at> postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
(Continue reading)

Richard Broersma | 9 Aug 2010 20:50
Picon

Re: Moving data from SQL Server to Postgres via VFP ODBC Driver

On Mon, Aug 9, 2010 at 11:31 AM, calvin smith
<calvinsmith266 <at> hotmail.com> wrote:

> Thank you for your reply. Actually I am dumping the data from SQLServer into
> Visual FoxPro memory variables on a record by record basis  and then
> checking the datatype for each memory variable.. If the data type is VFP
> character I am trimming the value so that I KNOW that what is going into my
> Insert statement is trimmed data.

I haven't used VFP.  Is it an ETL tool?

Another ETL tool to consider (its open source) that is JDBC based can
be found here:
http://sourceforge.net/projects/pentaho/files/Data%20Integration/4.0.0-stable/

Also, I don't know if you seen these migration resources:
http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#Microsoft_SQL_Server

Hopefully there is something useful there.

Also don't forget to reply-all so that the mailing list is included so
that others can reply.

--

-- 
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

(Continue reading)

Tom Lane | 9 Aug 2010 21:03
Picon

Re: Moving data from SQL Server to Postgres via VFP ODBC Driver

Calvin <calvinsmith266 <at> hotmail.com> writes:
> Is there any way to keep varying character fields from being padded out to their
> maximum length.

I suspect that your "varying" fields are in fact declared as just
CHAR(n).  Use VARCHAR(n), or if there isn't a particularly good reason
to have a specific length limit, use TEXT.

			regards, tom lane

--

-- 
Sent via pgsql-odbc mailing list (pgsql-odbc <at> postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc

Michal Seliga | 10 Aug 2010 09:25
Picon

i cannot use odbc with postgresql in linux

i am using ubuntu 10.04, with self compiled unixodbc 2.2.11 from ubuntu repository (its build such way that SQL WCHARS are 2 bytes long). unixodbc is then installed to /opt/unixodbc then i install postgresql from repository and pgsqlodbc-08.03.0200 from repository and build it with ./configure --with-unixodbc=/opt/unixodbc ; make; cp .libs/psqlodbcw.so /opt/unixodbc/lib then i create .odbc.ini entry to test database which works using psql and I do export LD_LIBRARY_PATH=/opt/unixodbc/lib /opt/unixodbc/bin/isql -v psqltest result is: [IM005][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_DBC failed [ISQL]ERROR: Could not SQLConnect i found many messages here about this problem, but no solution yet. any idea what i can do? i tried to use newev official version (08.04.200), cvs version from http://pgfoundry.org/scm/?group_id=1000125, but result was always the same i did the same things with mysql and their odbc driver and it works such way. i can use it both with isql and other programs. so i guess that how i build driver is not problem...or am i doing something really wrong? -- i tried to post this message using google groups but it seems it didn't got through. if it would be posted twice i am sorry...
Dennis Evans | 10 Aug 2010 21:16
Picon
Favicon

SQLPrepare

When using the PostGreSQL ODBC driver is calling SQLPrepare needed?   Or will the server compile, cache and
reuse the execution 

plan when SQLExecDIrect is used?

When using with MS-SQL the call does no harm but is really not needed SQL Server will compile and cache the
plan without calling SQLPrepare.

  Dennis

--

-- 
Sent via pgsql-odbc mailing list (pgsql-odbc <at> postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc

Victor Hugo | 13 Aug 2010 14:25
Picon

PGexpress v4.11 + postgresql 8.4.4

Hi,

Someone uses pgExpress Driver v4.11 with postgresql 8.4.4?

-- 
[]´s
Victor Hugo

--

-- 
Sent via pgsql-odbc mailing list (pgsql-odbc <at> postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc


Gmane