Re: [GENERAL] Import file into bytea field in SQL/plpgsql?

2008-03-05 Thread Douglas McNaught
On 3/5/08, Erwin Brandstetter <[EMAIL PROTECTED]> wrote: > The whole concept behind large objects is a bit off. Since we have > TOAST tables, it is of limited use to store large objects away in a > system table. It would be useful to have (additional) functions like: >lo_import(text) RETURNS

Re: [GENERAL] Import file into bytea field in SQL/plpgsql?

2008-03-05 Thread Erwin Brandstetter
On Mar 5, 10:20 am, [EMAIL PROTECTED] (Richard Huxton) wrote: > Erwin Brandstetter wrote: > > Hi! > > > What I want to do: > > Import a file from the file system into a bytea field of a table. (...) > Not that I know of. It's simple enough to do from the application side > of things of course (well

Re: [GENERAL] Import file into bytea field in SQL/plpgsql?

2008-03-05 Thread Richard Huxton
Erwin Brandstetter wrote: Hi! What I want to do: Import a file from the file system into a bytea field of a table. Now, I could copy over from pg_largeobject: And create a large object and export from there as above. But that seems unnecessarily complex, and .. well .. stupid. There must

[GENERAL] Import file into bytea field in SQL/plpgsql?

2008-03-04 Thread Erwin Brandstetter
Hi! What I want to do: Import a file from the file system into a bytea field of a table. I know how to do it with large objects: INSERT INTO mytable(oid_fld) VALUES (lo_import('/mypath/myfile')); And export from there: SELECT lo_export(oid_fld, '/mypath/myfile2') FROM mytable WHERE ; Now,

Re: [GENERAL] Import File

2005-08-24 Thread Brent Wood
On Tue, 23 Aug 2005, Rodrigo Africani wrote: > Hi, > > I'm trying to import a sequence txt file. > The file has fix columns ... i.e the first 10 positions is the primary key ... > The comand copy need a delimitier but the file is seq without a delimitier. > I look in the manual but i don't won't

Re: [GENERAL] Import File

2005-08-23 Thread A. Kretschmer
am 23.08.2005, um 11:47:57 -0300 mailte Rodrigo Africani folgendes: > Hi, > > I'm trying to import a sequence txt file. > The file has fix columns ... i.e the first 10 positions is the primary key ... > The comand copy need a delimitier but the file is seq without a delimitier. > I look in the ma

Re: [GENERAL] Import File

2005-08-23 Thread Michael Fuhr
On Tue, Aug 23, 2005 at 11:47:57AM -0300, Rodrigo Africani wrote: > I'm trying to import a sequence txt file. > The file has fix columns ... i.e the first 10 positions is the primary key ... > The comand copy need a delimitier but the file is seq without a delimitier. > I look in the manual but i d

[GENERAL] Import File

2005-08-23 Thread Rodrigo Africani
Hi,   I'm trying to import a sequence txt file. The file has fix columns ... i.e the first 10 positions is the primary key ... The comand copy need a delimitier but the file is seq without a delimitier. I look in the manual but i don't won't if it is possible. My problem is the file is very