Thread

  1. [QUESTIONS] builtin lo_unlink(int4)? why int4 not oid?

    C.S.Park <pcs@mhlx01.kek.jp> — 1998-06-13T02:18:30Z

    Hello all,
    
    e.g.
    
        I want to delete a large object with this table
    
    CREATE TABLE image (
        name            text,
        raster          oid
    );
    
    -- from programmer's guide
    
    in the psql
    
    foo=> select lo_unlink(raster) from image;
    ERROR:  function int4(oid) does not exist
    
    Why builtin "lo_unlink" is defined as accepting int4 not oid?  Then do I
    have to do
    foo=> select lo_unlink(int4(oid_text(raster))) from image;
    OR
    define "raster" as int4?  I don't think all these are good idea...  Then
    how to delete "lo" in the "psql"?
    
    Best Regards,
    C.S.Park
    
    
    
  2. Re: [HACKERS] [QUESTIONS] builtin lo_unlink(int4)? why int4 not oid?

    Peter T Mount <psqlhack@retep.org.uk> — 1998-06-13T09:58:12Z

    On Sat, 13 Jun 1998, Park, Chul-Su wrote:
    
    > Hello all,
    > 
    > e.g.
    > 
    >     I want to delete a large object with this table
    > 
    > CREATE TABLE image (
    >     name            text,
    >     raster          oid
    > );
    > 
    > -- from programmer's guide
    > 
    > in the psql
    > 
    > foo=> select lo_unlink(raster) from image;
    > ERROR:  function int4(oid) does not exist
    > 
    > Why builtin "lo_unlink" is defined as accepting int4 not oid?  Then do I
    > have to do
    > foo=> select lo_unlink(int4(oid_text(raster))) from image;
    > OR
    > define "raster" as int4?  I don't think all these are good idea...  Then
    > how to delete "lo" in the "psql"?
    
    I've just tested this, and I get the same thing (on 6.3.2, and yesterdays 
    CVS versions).
    
    lo_unlink should be defined with oid (which I thought was the case). 
    
    A temporary way round is:
    
    	select lo_unlink(raster::int4) from image;
    
    Hackers: Is there any reason why it's defined as an int4?
    
    -- 
    Peter T Mount peter@retep.org.uk or petermount@earthling.net
    Main Homepage: http://www.retep.org.uk
    ************ Someday I may rebuild this signature completely ;-) ************
    Work Homepage: http://www.maidstone.gov.uk Work EMail: peter@maidstone.gov.uk
    
    
    
  3. Re: [HACKERS] [QUESTIONS] builtin lo_unlink(int4)? why int4 not oid?

    Chul Su Park <pcs@bmail.kek.jp> — 1998-06-13T10:20:35Z

    > > foo=> select lo_unlink(raster) from image;
    > > ERROR:  function int4(oid) does not exist
    > > 
    > > Why builtin "lo_unlink" is defined as accepting int4 not oid?  Then do I
    > > have to do
    > > foo=> select lo_unlink(int4(oid_text(raster))) from image;
    > > OR
    > > define "raster" as int4?  I don't think all these are good idea...  Then
    > > how to delete "lo" in the "psql"?
    > 
    > I've just tested this, and I get the same thing (on 6.3.2, and yesterdays 
    > CVS versions).
    > 
    > lo_unlink should be defined with oid (which I thought was the case). 
    > 
    > A temporary way round is:
    > 
    > 	select lo_unlink(raster::int4) from image;
    > 
    > Hackers: Is there any reason why it's defined as an int4?
    > 
    > -- 
    > Peter T Mount peter@retep.org.uk or petermount@earthling.net
    
    
    foo=> select count(lo_unlink(raster::int4)) from bar;
    ERROR:  function int4(oid) does not exist
    
    I'm using v6.3.2(patched) on SunSolaris/Redhat5.0
    
    Best Regards, C.S.Park
    
    
    
  4. Re: [HACKERS] [QUESTIONS] builtin lo_unlink(int4)? why int4 not oid?

    Peter T Mount <psqlhack@retep.org.uk> — 1998-06-13T11:31:33Z

    On Sat, 13 Jun 1998, Chul Su Park wrote:
    
    > > > foo=> select lo_unlink(raster) from image;
    > > > ERROR:  function int4(oid) does not exist
    > > > 
    > > > Why builtin "lo_unlink" is defined as accepting int4 not oid?  Then do I
    > > > have to do
    > > > foo=> select lo_unlink(int4(oid_text(raster))) from image;
    > > > OR
    > > > define "raster" as int4?  I don't think all these are good idea...  Then
    > > > how to delete "lo" in the "psql"?
    > > 
    > > I've just tested this, and I get the same thing (on 6.3.2, and yesterdays 
    > > CVS versions).
    > > 
    > > lo_unlink should be defined with oid (which I thought was the case). 
    > > 
    > > A temporary way round is:
    > > 
    > > 	select lo_unlink(raster::int4) from image;
    > > 
    > > Hackers: Is there any reason why it's defined as an int4?
    > > 
    > > -- 
    > > Peter T Mount peter@retep.org.uk or petermount@earthling.net
    > 
    > 
    > foo=> select count(lo_unlink(raster::int4)) from bar;
    > ERROR:  function int4(oid) does not exist
    > 
    > I'm using v6.3.2(patched) on SunSolaris/Redhat5.0
    
    What patches have you applied?
    
    I'm running Redhat 4.1 on two machines. One has 6.3.2 (unpatched), the
    other the current CVS version, and the workaround worked.
    
    Infact on the current CVS machine, I just re-ran initdb, and tried the
    workaround again, and it worked.
    
    I'm just wondering if one of the patches has removed int4(oid).
    
    -- 
    Peter T Mount peter@retep.org.uk or petermount@earthling.net
    Main Homepage: http://www.retep.org.uk
    ************ Someday I may rebuild this signature completely ;-) ************
    Work Homepage: http://www.maidstone.gov.uk Work EMail: peter@maidstone.gov.uk
    
    
    
  5. Re: [HACKERS] [QUESTIONS] builtin lo_unlink(int4)? why int4 not oid?

    Bruce Momjian <maillist@candle.pha.pa.us> — 1998-06-13T20:26:30Z

    > I've just tested this, and I get the same thing (on 6.3.2, and yesterdays 
    > CVS versions).
    > 
    > lo_unlink should be defined with oid (which I thought was the case). 
    > 
    > A temporary way round is:
    > 
    > 	select lo_unlink(raster::int4) from image;
    > 
    > Hackers: Is there any reason why it's defined as an int4?
    
    Here is a patch for to make lo_unlink use oid, not int4.
    
    ---------------------------------------------------------------------------
    
    Index: src/include/catalog/pg_proc.h
    ===================================================================
    RCS file: /usr/local/cvsroot/pgsql/src/include/catalog/pg_proc.h,v
    retrieving revision 1.59
    diff -c -r1.59 pg_proc.h
    *** pg_proc.h	1998/05/29 13:36:31	1.59
    --- pg_proc.h	1998/06/13 20:23:49
    ***************
    *** 1174,1180 ****
      DATA(insert OID = 963 (  close_lb		   PGUID 11 f t f 2 f 600 "628 603" 100 0 10 100  foo bar ));
      DESCR("closest point to line on box");
      
    ! DATA(insert OID = 964 (  lo_unlink		   PGUID 11 f t f 1 f  23 "23" 100 0 0 100	foo bar ));
      DESCR("large object unlink(delete)");
      DATA(insert OID = 972 (  regproctooid	   PGUID 11 f t f 1 f  26 "24" 100 0 0 100	foo bar ));
      DESCR("get oid for regproc");
    --- 1174,1180 ----
      DATA(insert OID = 963 (  close_lb		   PGUID 11 f t f 2 f 600 "628 603" 100 0 10 100  foo bar ));
      DESCR("closest point to line on box");
      
    ! DATA(insert OID = 964 (  lo_unlink		   PGUID 11 f t f 1 f  23 "26" 100 0 0 100	foo bar ));
      DESCR("large object unlink(delete)");
      DATA(insert OID = 972 (  regproctooid	   PGUID 11 f t f 1 f  26 "24" 100 0 0 100	foo bar ));
      DESCR("get oid for regproc");
    
    
    -- 
    Bruce Momjian                          |  830 Blythe Avenue
    maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
      +  If your life is a hard drive,     |  (610) 353-9879(w)
      +  Christ can be your backup.        |  (610) 853-3000(h)