Re: Large Object => invalid input syntax for integer: ""

From: grupos <grupos(at)carvalhaes(dot)net>
To: Douglas McNaught <doug(at)mcnaught(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Large Object => invalid input syntax for integer: ""
Date: 2005-06-06 13:50:09
Message-ID: 42A45491.9090106@carvalhaes.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Douglas,

Thanks for your promptly answer. Here is the "step by step":

CREATE TABLE test
(
description varchar(20),
picture lo
)
WITHOUT OIDS;

INSERT INTO test (description) VALUES ('1');

And then, the error : INSERT INTO test (description) VALUES ('1')

What I am trying to do is insert data only on the column description,
leaving the column picture null (because for this tuple there is no image).

Regards,

Rodrigo Carvalhaes

Douglas McNaught wrote:

>grupos <grupos(at)carvalhaes(dot)net> writes:
>
>
>
>>I need to use large objects BUT I am having problemns... I instaled
>>PostgreSQL 8.0.3 windows version with lo module.
>>
>>first, I created the table below:
>>CREATE TABLE test
>>(
>> description varchar(20),
>> picture lo
>>)
>>WITHOUT OIDS;
>>
>>After trying to make one insert without value for the lo I get the
>>error below:
>>
>>INSERT INTO test VALUES (1);
>>
>>ERROR: invalid input syntax for integer: ""
>>
>>
>
>This means you're trying to insert an integer value into the
>"description" column, which is text. It has nothing to do with large
>objects.
>
>To insert an LO into a database, you do the following:
>
>BEGIN a transaction
>Call lo_create() to make a new large object. The return value is the
> OID of the LO, which you will need later.
>Call lo_write() and lo_close() to put data into the LO
>Insert the OID you got from lo_create() in the referencing column
> ("picture", in your case)
>COMMIT the transaction
>
>It's a little annoying but that's how it works.
>
>-Doug
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
>
>

--
Esta mensagem foi verificada pelo sistema de antivírus e
acredita-se estar livre de perigo.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message FERREIRA, William (COFRAMI) 2005-06-06 13:52:44 Re: Large Object => invalid input syntax for integer: ""
Previous Message Douglas McNaught 2005-06-06 13:37:32 Re: Large Object => invalid input syntax for integer: ""