Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



do you really need to use lo module ?
try this ...

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

if you want to import a BLOB :
insert into test values ("toto", lo_import('mypicture'))

and if you want no value
insert into test values ("toto", 0)

-----Message d'origine-----
De : pgsql-general-owner@xxxxxxxxxxxxxx
[mailto:pgsql-general-owner@xxxxxxxxxxxxxx]De la part de grupos
Envoyé : lundi 6 juin 2005 15:28
À : Douglas McNaught
Cc : pgsql-general@xxxxxxxxxxxxxx
Objet : Re:  Large Object => invalid input syntax for integer:
""


Hi Doug!

Thanks for your e-mail BUT the point is how I insert data on a table 
when the column lo have no value ( NULL), to insert the lo I have no 
problem BUT the problem is when the column should have no value...

Regards,

Rodrigo Carvalhaes

Douglas McNaught wrote:

>grupos <grupos@xxxxxxxxxxxxxx> 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
>
>  
>

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


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

This mail has originated outside your organization,
either from an external partner or the Global Internet. 
Keep this in mind if you answer this message.

This e-mail is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error please delete it and immediately notify the sender.
Security Notice: all e-mail, sent to or from this address, may be
accessed by someone other than the recipient, for system management and
security reasons. This access is controlled under Regulation of
Investigatory Powers Act 2000, Lawful Business Practises.

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@xxxxxxxxxxxxxx


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux