Re: [HACKERS] proposal: lob conversion functionality

2013-10-27 Thread Pavel Stehule
2013/10/26 Noah Misch > On Fri, Oct 25, 2013 at 03:35:05PM +0200, Pavel Stehule wrote: > > 2013/10/24 Heikki Linnakangas > > > On 22.10.2013 13:55, Pavel Stehule wrote: > > >> 2013/10/21 Noah Misch > > >>> If you're prepared to change the function names and add the > > >>> subset-oriented > > >>

Re: [HACKERS] proposal: lob conversion functionality

2013-10-26 Thread Noah Misch
On Fri, Oct 25, 2013 at 03:35:05PM +0200, Pavel Stehule wrote: > 2013/10/24 Heikki Linnakangas > > On 22.10.2013 13:55, Pavel Stehule wrote: > >> 2013/10/21 Noah Misch > >>> If you're prepared to change the function names and add the > >>> subset-oriented > >>> functions, I would appreciate that.

Re: [HACKERS] proposal: lob conversion functionality

2013-10-25 Thread Pavel Stehule
fixed documentation Regards Pavel 2013/10/24 Heikki Linnakangas > On 22.10.2013 13:55, Pavel Stehule wrote: > >> 2013/10/21 Noah Misch >> >>> If you're prepared to change the function names and add the >>> subset-oriented >>> functions, I would appreciate that. >>> >>> here is patch >> > > l

Re: [HACKERS] proposal: lob conversion functionality

2013-10-24 Thread Heikki Linnakangas
On 22.10.2013 13:55, Pavel Stehule wrote: 2013/10/21 Noah Misch If you're prepared to change the function names and add the subset-oriented functions, I would appreciate that. here is patch lobj.sgml still refer to the old names. - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hack

Re: [HACKERS] proposal: lob conversion functionality

2013-10-22 Thread Pavel Stehule
Hello here is patch Regards Pavel 2013/10/21 Noah Misch > On Mon, Oct 21, 2013 at 08:10:24PM +0200, Pavel Stehule wrote: > > > On 10/20/2013 07:52 PM, Noah Misch wrote: > > >> Anything we do here effectively provides wrappers around the existing > > >> functions tailored toward the needs of

Re: [HACKERS] proposal: lob conversion functionality

2013-10-21 Thread Pavel Stehule
2013/10/21 Noah Misch > On Mon, Oct 21, 2013 at 08:10:24PM +0200, Pavel Stehule wrote: > > > On 10/20/2013 07:52 PM, Noah Misch wrote: > > >> Anything we do here effectively provides wrappers around the existing > > >> functions tailored toward the needs of libpq. > > To clarify the above stateme

Re: [HACKERS] proposal: lob conversion functionality

2013-10-21 Thread Noah Misch
On Mon, Oct 21, 2013 at 08:10:24PM +0200, Pavel Stehule wrote: > > On 10/20/2013 07:52 PM, Noah Misch wrote: > >> Anything we do here effectively provides wrappers around the existing > >> functions tailored toward the needs of libpq. To clarify the above statement: the existing lo* SQL functions

Re: [HACKERS] proposal: lob conversion functionality

2013-10-21 Thread Pavel Stehule
Hello 2013/10/21 Andrew Dunstan > > On 10/20/2013 07:52 PM, Noah Misch wrote: > >> Consider this list of new functions in their place: >> >> lo_create(oid, bytea) RETURNS oid -- new LO with content (similar to >> make_lo) >> lo_get(oid) RETURNS bytea-- read entire LO (s

Re: [HACKERS] proposal: lob conversion functionality

2013-10-21 Thread Andrew Dunstan
On 10/20/2013 07:52 PM, Noah Misch wrote: Consider this list of new functions in their place: lo_create(oid, bytea) RETURNS oid -- new LO with content (similar to make_lo) lo_get(oid) RETURNS bytea-- read entire LO (same as load_lo) lo_get(oid, bigint, int) RETURNS byt

Re: [HACKERS] proposal: lob conversion functionality

2013-10-20 Thread Pavel Stehule
2013/10/21 Noah Misch > On Mon, Sep 30, 2013 at 01:06:15PM +0300, Heikki Linnakangas wrote: > > On 12.08.2013 21:08, Pavel Stehule wrote: > >> 2013/8/10 Tom Lane: > >>> Pavel Stehule writes: > I found so there are no simple API for working with LO from PL without > access to file syste

Re: [HACKERS] proposal: lob conversion functionality

2013-10-20 Thread Noah Misch
On Mon, Sep 30, 2013 at 01:06:15PM +0300, Heikki Linnakangas wrote: > On 12.08.2013 21:08, Pavel Stehule wrote: >> 2013/8/10 Tom Lane: >>> Pavel Stehule writes: I found so there are no simple API for working with LO from PL without access to file system. >>> >>> What? See lo_open(), lor

Re: [HACKERS] proposal: lob conversion functionality

2013-09-30 Thread Pavel Stehule
2013/9/30 Heikki Linnakangas > On 12.08.2013 21:08, Pavel Stehule wrote: > >> 2013/8/10 Tom Lane: >> >>> Pavel Stehule> >>> writes: >>> I found so there are no simple API for working with LO from PL without access to file system. >>> >>> What? See lo_open(), loread(), lowrite(),

Re: [HACKERS] proposal: lob conversion functionality

2013-09-30 Thread Heikki Linnakangas
On 12.08.2013 21:08, Pavel Stehule wrote: 2013/8/10 Tom Lane: Pavel Stehule writes: I found so there are no simple API for working with LO from PL without access to file system. What? See lo_open(), loread(), lowrite(), etc. yes, so there are three problems with these functions: a) proba

Re: [HACKERS] proposal: lob conversion functionality

2013-09-19 Thread Rushabh Lathia
On Thu, Sep 19, 2013 at 10:19 PM, Pavel Stehule wrote: > Hello > > here is patch > Looks good. Marking it as Ready for Committer. > > Regards > > Pavel > > > > 2013/9/19 Pavel Stehule > >> >> >> >> 2013/9/19 Rushabh Lathia >> >>> Hi Pavel, >>> >>> I have reviewed you patch. >>> >>> -- Patch

Re: [HACKERS] proposal: lob conversion functionality

2013-09-19 Thread Pavel Stehule
Hello here is patch Regards Pavel 2013/9/19 Pavel Stehule > > > > 2013/9/19 Rushabh Lathia > >> Hi Pavel, >> >> I have reviewed you patch. >> >> -- Patch got applied cleanly (using patch -p1) >> -- Make & Make install works fine >> -- make check looks good >> >> I done code-walk and it loo

Re: [HACKERS] proposal: lob conversion functionality

2013-09-19 Thread Pavel Stehule
2013/9/19 Rushabh Lathia > Hi Pavel, > > I have reviewed you patch. > > -- Patch got applied cleanly (using patch -p1) > -- Make & Make install works fine > -- make check looks good > > I done code-walk and it looks good. Also did some manual testing and > haven't > found any issue with the imple

Re: [HACKERS] proposal: lob conversion functionality

2013-09-19 Thread Rushabh Lathia
Hi Pavel, I have reviewed you patch. -- Patch got applied cleanly (using patch -p1) -- Make & Make install works fine -- make check looks good I done code-walk and it looks good. Also did some manual testing and haven't found any issue with the implementation. Patch introduced two new API load_

Re: [HACKERS] proposal: lob conversion functionality

2013-08-25 Thread Pavel Stehule
2013/8/25 Pavel Stehule > Hello > > here is a patch > > it introduce a load_lo and make_lo functions > > postgres=# select make_lo(decode('ff00','hex')); > make_lo > ─ >24629 > (1 row) > > Time: 40.724 ms > postgres=# select load_lo(24628); > load_lo > > \xff0

Re: [HACKERS] proposal: lob conversion functionality

2013-08-25 Thread Pavel Stehule
Hello here is a patch it introduce a load_lo and make_lo functions postgres=# select make_lo(decode('ff00','hex')); make_lo ─ 24629 (1 row) Time: 40.724 ms postgres=# select load_lo(24628); load_lo \xff00 (1 row) postgres=# \lo_import ~/avatar.png lo_import

Re: [HACKERS] proposal: lob conversion functionality

2013-08-22 Thread Jov
+1 badly need the large object and bytea convert function. Once I have to use the ugly pg_read_file() to put some text to pg,I tried to use large object but find it is useless without function to convert large object to bytea. Jov blog: http:amutu.com/blog 2013/8/10 Pave

Re: [HACKERS] proposal: lob conversion functionality

2013-08-21 Thread Pavel Stehule
2013/8/21 Jim Nasby > On 8/12/13 1:08 PM, Pavel Stehule wrote: > >>IF (bytes != LENGTH($1)) THEN >> RAISE EXCEPTION 'Not all data copied to blob'; >>END IF; >>PERFORM lo_close(fd); >> > > FWIW, it's probably better to close before raising the exception... > it should to be done

Re: [HACKERS] proposal: lob conversion functionality

2013-08-21 Thread Jim Nasby
On 8/12/13 1:08 PM, Pavel Stehule wrote: IF (bytes != LENGTH($1)) THEN RAISE EXCEPTION 'Not all data copied to blob'; END IF; PERFORM lo_close(fd); FWIW, it's probably better to close before raising the exception... -- Jim C. Nasby, Data Architect j...@nasby.

Re: [HACKERS] proposal: lob conversion functionality

2013-08-12 Thread Pavel Stehule
Hello 2013/8/12 Pavel Stehule : > 2013/8/10 Tom Lane : >> Pavel Stehule writes: >>> I found so there are no simple API for working with LO from PL without >>> access to file system. >> >> What? See lo_open(), loread(), lowrite(), etc. >> so simplified functionality should have a little bit diff

Re: [HACKERS] proposal: lob conversion functionality

2013-08-12 Thread Pavel Stehule
2013/8/10 Tom Lane : > Pavel Stehule writes: >> I found so there are no simple API for working with LO from PL without >> access to file system. > > What? See lo_open(), loread(), lowrite(), etc. > yes, so there are three problems with these functions: a) probably (I didn't find) undocumented

Re: [HACKERS] proposal: lob conversion functionality

2013-08-10 Thread Tom Lane
Pavel Stehule writes: > I found so there are no simple API for working with LO from PL without > access to file system. What? See lo_open(), loread(), lowrite(), etc. > These functions can be simplified if we supports some functions like > encode, decode for LO I do not see any good reason to