Hajo Kirchhoff | 1 Oct 2005 09:45
Picon

Re: postgresql-odbc vs. unixODBC

Hi,

> 
> does anybody know what the differences are between postgresql-odbc
> and unixODBC? because connection via postgresql-odbc work and
> via unixODBC fails!

you should check the driver versions. I think I remember seeing a post 
that said that the postgreSQL unixODBC is an outdated version of the 
postgreSQL ODBC driver that was included by the unixODBC team.

At any rate I'd always use the latest driver available directly from the 
ODBC team here.

Hajo

> 
> here some infos:
> 
> my /etc/odbcinst.ini:
> ---------------------
> [PostgreSQL]
> Description     = ODBC for PostgreSQL (postgresql-odbc)
> Driver          = /usr/lib/psqlodbc.so
> FileUsage       = 1
>  
> [PostgreSQL2]
> Description     = ODBC for PostgreSQL (unixODBC)
> Driver          = /usr/lib/libodbcpsql.so
> FileUsage       = 1
(Continue reading)

lothar.behrens | 1 Oct 2005 10:30
Picon

Re: select count(*) datatype ?

Am 30 Sep 2005 um 17:57 hat lothar.behrens <at> lollisoft.de geschrieben:

I have solved that problem. Open Watcom has a function atoll and lltoa for long
long conversion. I'll try this on Linux and Mac later, there may be similar functions.

Lothar

> Am 30 Sep 2005 um 9:54 hat Tom Lane geschrieben:
>
> > lothar.behrens <at> lollisoft.de writes:
> > > what type of column is an aggregated value of count ?
> >
> > bigint, at least in recent PG releases.
> >
> > 			regards, tom lane
> >
>
> Thanks,
>
> but now I am a little confused about how to convert those datatypes to a char[] type.
>
> I write long datatypes from char[] array into bound buffer:
>
> long l = 0;
> l = atol("long value");
> long* pl = (long*) buffer;
> void* b = pl+1;
> memcpy(b, &l, sizeof(l));
>
> I read long datatypes into char[] array from bound buffer:
(Continue reading)

Andrus | 3 Oct 2005 20:44
Picon

Get error message details

In PgAdmin running code

create table t1 ( c1 serial primary key );
create table t2 ( c1 integer references t1);
insert into t1 values(1);
insert into t2 values (1);
delete from t1;

causes nice detailed error message

ERROR:  update or delete on "t1" violates foreign key constraint 
"t2_c1_fkey" on "t2"
DETAIL:  Key (c1)=(1) is still referenced from table "t2".

Runnign this code through ODBC I got only ERROR: line

How to retrieve the DETAIL: line using ODBC ?

Andrus. 

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

Chris Ingram | 4 Oct 2005 00:04

Re: PATCH: Integrity constraint violation should set SQLSTATE to 23000

Thanks for pointing out a much better way to address the problem, Dave.

I've attached a patch that uses the SQLSTATE from the backend any time
the error condition after executing a query is
STMT_ERROR_TAKEN_FROM_BACKEND.  Besides solving the problem I reported,
this seems to make much more sense than setting the SQLSTATE arbitrarily
to HY000 "General Error" in this situation.  I look forward to your
feedback.

--
Chris Ingram
Software Developer, Intellisync Corporation
cingram <at> intellisync.com
www.intellisync.com

-----Original Message-----
From: Dave Page [mailto:dpage <at> vale-housing.co.uk] 
Sent: Friday, September 30, 2005 12:15 PM
To: Chris Ingram; pgsql-odbc <at> postgresql.org
Subject: RE: [ODBC] Integrity constraint violation should set SQLSTATE
to 23000

> -----Original Message-----
> From: pgsql-odbc-owner <at> postgresql.org 
> [mailto:pgsql-odbc-owner <at> postgresql.org] On Behalf Of Chris Ingram
> Sent: 30 September 2005 16:30
> To: pgsql-odbc <at> postgresql.org
> Subject: [ODBC] Integrity constraint violation should set 
> SQLSTATE to 23000
> 
(Continue reading)

Zlatko Matić | 3 Oct 2005 01:14
Picon

Unbound text box, Text > 255 characters, MSAccess/PostgreSQL

Hello.
I have the following problem with MS Access/PostgreSQL combination:
There is a form in Access that has an unbound text box, used for entering a commentary of a batch of records.
There is a DAO Append Query that has a parameter that is passed from the text box using parameter of DAO QueryDef object.
I adjusted B7 parameter (Text as LongVarchar) in connection string (ODBC driver) to 1, so that Access links PostgreSQL Text fields as Memo fields in Access. The intention was to be able to enter unlimited length commentary into the field.
But, although I can enter unlimited text by using bound text box in some other forms, in this particular form I can't use bound control, so I need to pass text from  UNBOUND control to the linked table by using DAO or ADO code. It seems that DAO query can't accept Memo as parameter, but only text. If my text exceeds length of 255, I have an VBA error 3271. If text in unbound text box is shorter that 255 everything is OK.
 
So, is there any way to pass text of length >255 from unbound text box to Memo field of linked PostgreSQL table, by using DAO or ADO ?
 
Thanks in advance,
 
Zlatko
Greg Campbell | 4 Oct 2005 15:34

Re: Unbound text box, Text > 255 characters, MSAccess/PostgreSQL

What version of Access?
Confirm that Access is interpreting the target field as MEMO, (either look at the linked table in design 
mode, or use Tools->Analyze->Documenter).
For the query, determine the "type" of the parameter - Query menu->Parameters. Be sure you are using type 
MEMO.

By the way, 3271 is a Jet error -- Invalid property value.

Good luck.

Zlatko Matić wrote:

> Hello.
> I have the following problem with MS Access/PostgreSQL combination:
> There is a form in Access that has an unbound text box, used for entering a commentary of a batch of records.
> There is a DAO Append Query that has a parameter that is passed from the text box using parameter of DAO
QueryDef object. 
> I adjusted B7 parameter (Text as LongVarchar) in connection string (ODBC driver) to 1, so that Access
links PostgreSQL Text fields as Memo fields in Access. The intention was to be able to enter unlimited
length commentary into the field.
> But, although I can enter unlimited text by using bound text box in some other forms, in this particular
form I can't use bound control, so I need to pass text from  UNBOUND control to the linked table by using DAO or
ADO code. It seems that DAO query can't accept Memo as parameter, but only text. If my text exceeds length of
255, I have an VBA error 3271. If text in unbound text box is shorter that 255 everything is OK.
> 
> So, is there any way to pass text of length >255 from unbound text box to Memo field of linked PostgreSQL
table, by using DAO or ADO ?
> 
> Thanks in advance,
> 
> Zlatko
Attachment (greg.campbell.vcf): text/x-vcard, 241 bytes

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match
Dave Page | 4 Oct 2005 21:04
Picon

Re: PATCH: Integrity constraint violation should set SQLSTATE to 23000


> -----Original Message-----
> From: Chris Ingram [mailto:cingram <at> intellisync.com] 
> Sent: 03 October 2005 23:04
> To: Dave Page
> Cc: pgsql-odbc <at> postgresql.org
> Subject: RE: [ODBC] PATCH: Integrity constraint violation 
> should set SQLSTATE to 23000
> 
> Thanks for pointing out a much better way to address the 
> problem, Dave.
> 
> I've attached a patch that uses the SQLSTATE from the backend any time
> the error condition after executing a query is
> STMT_ERROR_TAKEN_FROM_BACKEND.  Besides solving the problem I 
> reported,
> this seems to make much more sense than setting the SQLSTATE 
> arbitrarily
> to HY000 "General Error" in this situation.  I look forward to your
> feedback.

Thanks Chris - patch applied.

Regards, Dave.

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo <at> postgresql.org so that your
       message can get through to the mailing list cleanly

Joel Fradkin | 5 Oct 2005 00:27

Just as an FYI We are up solid now on pgsql libpq version

Hi Dave,

 

Thought I would give you an update.

We have been up solid. I built the version we are using just prior to your separating aschii and non aschii (so it’s the non aschii version).

I have not seen any odbc related issues. I am still using the 7.4 non libpq version with my DTS dumps from SQL server, but our production web servers have been working great on 8.0.3 postgres.

 

I have heard the 8.1 is supposed to be faster and will look at converting to it at some time in the future, but since the speed has been great and the reliability has been great I am almost afraid to touch anything.

 

My thanks go out again to all the wonderful folks on list that helped me resolve the issues.

 

Joel Fradkin

 

Wazagua, Inc.
2520 Trailmate Dr
Sarasota, Florida 34243
Tel.  941-753-7111 ext 305

 

jfradkin <at> wazagua.com
www.wazagua.com
Powered by Wazagua
Providing you with the latest Web-based technology & advanced tools.
© 2004. WAZAGUA, Inc. All rights reserved. WAZAGUA, Inc
 This email message is for the use of the intended recipient(s) and may contain confidential and privileged information.  Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply email and delete and destroy all copies of the original message, including attachments.

 


 

 

Dave Page | 5 Oct 2005 09:31
Picon

Re: Just as an FYI We are up solid now on pgsql libpq version

 

From: pgsql-odbc-owner <at> postgresql.org [mailto:pgsql-odbc-owner <at> postgresql.org] On Behalf Of Joel Fradkin
Sent: 04 October 2005 23:27
To: pgsql-odbc <at> postgresql.org
Subject: [ODBC] Just as an FYI We are up solid now on pgsql libpq version

Hi Dave, 

 

Hi Joel,

 

Thought I would give you an update.

We have been up solid. I built the version we are using just prior to your separating aschii and non aschii (so it’s the non aschii version).

I have not seen any odbc related issues. I am still using the 7.4 non libpq version with my DTS dumps from SQL server, but our production web servers have been working great on 8.0.3 postgres.

 

Excellent news - hopefully you boss is somewhat happier now as well :-)

 

It might be worth trying the very latest CVS code with your DTS packages - there's at least one fix in there specifically for a SQL Server problem, plus the ANSI build of the driver is much more akin to the 7,4 series.

 

I have heard the 8.1 is supposed to be faster and will look at converting to it at some time in the future, but since the speed has been great and the reliability has been great I am almost afraid to touch anything.

 

I would consider upgrading to 8.0.4 which is just out (and is a simple upgrade to 8.0.3 with no dump/reload), but hold off on 8.1 until you have good reason to upgrade. It seems unwise to upgrade a stable system just because you *might* gain a few seconds on the odd query.

 

My thanks go out again to all the wonderful folks on list that helped me resolve the issues.

 

No problem - glad to help. Thanks for bearing with us whilst we brought the new driver up to speed!

 

Regards, Dave.

Tom Lane | 5 Oct 2005 19:50
Picon

Insecurity of ODBC debug logging files

I have a gripe here:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=154126
about the fact that ODBC is willing to store passwords into debug log
files that aren't secure.  Anyone want to do something about it?

Offhand it seems like simply omitting the password from the log wouldn't
be a bad idea.  But even then, a log file will frequently contain
sensitive data (eg, credit card numbers appearing in INSERT statements).
Seems to me that there should also be some care taken to make the log
file not world-readable.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match


Gmane