Thread

  1. A couple of LIBPQ questions

    Bruce Tong <zztong@laxmi.ev.net> — 1998-06-05T18:12:57Z

    (1) PQftype() returns a value of type "Oid", but I haven't been able to
    find a list of what those values might be. I noticed in the header files a
    value of zero is considered invalid, but that's it. The docs I've found
    don't tell me anything other than it an integer code representing the
    type. What are the possible values?
    
    (2) I noticed there are some C++ classes in /usr/include/libpq++ which
    look similar to code I'm writing for my own education and use. Is there
    any documentation which deals with these classes? (I've not seen any thus
    far.)
    
    (3) The third paramter to PQsetdb() is pgoptions. I've not found any
    description of what these options might be. Where can I find a list of the
    options?
    
    
    Bruce Tong
    Systems Programmer
    Electronic Vision / FITNE
    
    mailto: zztong@laxmi.ev.net
    http://www.ev.net/fitne
    
    
    
  2. Postgres error.....

    PostreSQL Server <postgres@tmt.kaybee.org> — 1998-06-05T18:33:53Z

    i wrote this simple script that exports a large object from database to a
    file using the same database that contains a table  which matches the
    objOid's to their names.  The script will work sometimes but sometimes it
    doesn't.   Any one have any ideas...??? here is the script and the error.
    
    
    proc export_file_lo { large_object_name filename {db "lo_db"} {host
    "localhost"}
     {port "5432"} } {
    
         global lo_continue
         set conn [pg_connect $db -host $host -port $port]
    
         set lo_continue "false"
    
         pg_select $conn "SELECT * from match where name=
    	\'$large_object_name\'" result {set objOid [process_result result]}
    
         if {$lo_continue == "true"} {
    
              pg_lo_export $conn $objOid $filename
         } else {
              puts "No object associated with name \"$large_object_name\" found."
              pg_disconnect $conn
              return 0
         }
    
         pg_disconnect $conn
         return 1
    
    
    }
    
    proc process_result {arrName} {
    global lo_continue
    upvar $arrName result
    
         set lo_continue "true"
         set objOid $result(objoid)
    
         return $objOid
    }
    
    
    
    Output:
    
    	NOTICE:  SIAssignBackendId: discarding tag 2147483553
    	Connection to database failed
    	FATAL 1:  Backend cache invalidation initialization failed
    
    
    
    
    thanks,tim
    
    
    
  3. Re: [GENERAL] A couple of LIBPQ questions

    Marin D <marin@cybernet.bg> — 1998-06-06T09:52:23Z

    
    On Fri, 5 Jun 1998, Bruce Tong wrote:
    
    > (1) PQftype() returns a value of type "Oid", but I haven't been able to
    > find a list of what those values might be. I noticed in the header files a
    > value of zero is considered invalid, but that's it. The docs I've found
    > don't tell me anything other than it an integer code representing the
    > type. What are the possible values?
    
    select oid,* from pg_type where oid = <type_oid>
    
    where <type_oid> is between 16 and 32
    
    > 
    > (2) I noticed there are some C++ classes in /usr/include/libpq++ which
    > look similar to code I'm writing for my own education and use. Is there
    > any documentation which deals with these classes? (I've not seen any thus
    > far.)
    > 
    
    Neither did I.
    
    > (3) The third paramter to PQsetdb() is pgoptions. I've not found any
    > description of what these options might be. Where can I find a list of the
    > options?
    > 
    > 
    
    The source says this is for setting backend options for this connection.
    
    man postgres 
    
    to see the backend options.
    
    
    Hope this helps..
    
    	Marin
    
     
              -= Why do we need gates in a world without fences? =-
    
    
    
    
  4. Re: [GENERAL] A couple of LIBPQ questions

    Marin D <marin@cybernet.bg> — 1998-06-06T14:25:26Z

    
    On Sat, 6 Jun 1998, Marin D wrote:
    
    > 
    > > 
    > > (2) I noticed there are some C++ classes in /usr/include/libpq++ which
    > > look similar to code I'm writing for my own education and use. Is there
    > > any documentation which deals with these classes? (I've not seen any thus
    > > far.)
    > > 
    > 
    > Neither did I.
    > 
    
    Silly to correct myself but there is a nice man page
    
    man libpq++
    
    
    Best regards
    
    	Marin
    
    
              -= Why do we need gates in a world without fences? =-
    
    
    
    
  5. Re: [GENERAL] A couple of LIBPQ questions

    Bruce Tong <zztong@laxmi.ev.net> — 1998-06-08T13:47:42Z

    > > (1) PQftype() returns a value of type "Oid", but I haven't been able to
    > > find a list of what those values might be. I noticed in the header files a
    > > value of zero is considered invalid, but that's it. The docs I've found
    > > don't tell me anything other than it an integer code representing the
    > > type. What are the possible values?
    > 
    > select oid,* from pg_type where oid = <type_oid>
    > 
    > where <type_oid> is between 16 and 32
    
    Thats interesting. How in the world did you ever know to look there?
    
    > > (3) The third paramter to PQsetdb() is pgoptions. I've not found any
    > > description of what these options might be. Where can I find a list of the
    > > options?
    > 
    > The source says this is for setting backend options for this connection.
    > 
    > man postgres 
    > 
    > to see the backend options.
    
    Ahhh, I see. Boy I feel dumb for not having made that connection.
    
    
    Bruce Tong
    Systems Programmer
    Electronic Vision / FITNE
    
    mailto: zztong@laxmi.ev.net
    http://www.ev.net/fitne
    
    
    
  6. Re: [GENERAL] A couple of LIBPQ questions

    Bruce Tong <zztong@laxmi.ev.net> — 1998-06-08T14:00:07Z

    > > > (2) I noticed there are some C++ classes in /usr/include/libpq++ which
    > > > look similar to code I'm writing for my own education and use. Is there
    > > > any documentation which deals with these classes? (I've not seen any thus
    > > > far.)
    > > 
    > > Neither did I.
    > 
    > Silly to correct myself but there is a nice man page
    > 
    > man libpq++
    
    So there is. I'm kicking myself now since I had found the libpq man page.
    Ahh, I see. They've put the developer stuff in another RPM, so none of
    this was showing up in the list of files belonging to the postgresql
    package. This will give me some more things to look at.
    
    Thanks a bunch.
    
    
    Bruce Tong
    Systems Programmer
    Electronic Vision / FITNE
    
    mailto: zztong@laxmi.ev.net
    http://www.ev.net/fitne