Thread: [Fwd: [INTERFACES] type error inserting large obj, Win32 ODBC]

[Fwd: [INTERFACES] type error inserting large obj, Win32 ODBC]

From
Byron Nikolaidis
Date:



Sam O'Connor wrote:

> I have attached the logs.
> Thankyou very much for your help.
>
> Sam O'Connor
>
>

I don't really see the problem.  It seems more like there is something wrong on the postgres side.

create type lo (internallength=4,externallength=10,input=int4in,output=int4out,
                default='',passedbyvalue);

If this is what you typed in to create the "lo" type, then it should work.  Try inserting a row manually into the
table,say something like: 

insert into image ( 1, 2, 'stuff', 5);

If this fails, then maybe there is something weird with the i/o routines (int4in, int4out), in which case, you should
seekmore help from perhaps the "general" 
mailing list.

Byron



Re: [Fwd: [INTERFACES] type error inserting large obj, Win32 ODBC]

From
Byron Nikolaidis
Date:

Sam O'Connor wrote:

> Problem solved!
>
> I modified the ODBC driver to put single quotes around the oid in the
> SQL query.
> Now it works.
>
> I can send you a diff if you like.
>
> I figured this out by trying (in psql):
> INSERT INTO image VALUES (1,1,'test',123); // causes an error
> INSERT INTO image VALUES (1,1,'test','123'); // this works
>

Ahhhh,  I see now.   On Postgres 6.3 it works with or without the quotes.  But, on Postgres 6.4, it must be quoted!

I wonder if this was an intentional change, or a bug or what?

I will try to post a patch for the quotes.

Byron