Thread

  1. Re: [GENERAL] libq++ and security help

    Peter Mount <pgsqlgen@retep.org.uk> — 1998-06-16T05:50:12Z

    On Mon, 15 Jun 1998, Bruce Tong wrote:
    
    > > 	I'm using libq++ for a C++ frontend; the problem is I need to have 
    > > many users who don't have accounts on the server. I tried to find 
    > > information on connecting to the database specifying the username and 
    > > password, but it looks like the libq++ functions rely on the environment 
    > > variables. 
    > 
    > This seems to be the same for LIBPQ. (The non-C++ version of the library.)
    > Thus, I'm curious what the answer is in this case as well.
    
    I'm not sure about libq++, but for libpq, you can do this by using
    PQconnectdb(). The easiest way, is to look at the source to psql, which
    uses libpq itself.
    
    PGconn *db = PQconnectdb("host=myhost user=myuser password=mypassword port=myport");
    
    -- 
    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
    
    
    
  2. Re: [GENERAL] libq++ and security help

    Bruce Tong <zztong@laxmi.ev.net> — 1998-06-16T11:59:31Z

    > I'm not sure about libq++, but for libpq, you can do this by using
    > PQconnectdb(). The easiest way, is to look at the source to psql, which
    > uses libpq itself.
    > 
    > PGconn *db = PQconnectdb("host=myhost user=myuser password=mypassword port=myport");
    
    Whoa, neat. I guess I'm going to have to start looking at the source. That
    function isn't in the documentation for LIBPQ. Thanks for the pointer.
    
    
    Bruce Tong
    Systems Programmer
    Electronic Vision / FITNE
    
    mailto: zztong@laxmi.ev.net
    http://www.ev.net/fitne