Thread: how to use pg-connect ?

how to use pg-connect ?

From
Cécile DESNOYERS
Date:
Hello,


    I'd like to know if there is a way to use pg_connect() with a
different host than « localhost ».
    I tried to put an IP address or a server name but it didn't work. Has
anybody ever used pg_connect with something else than localhost ?


    Thank you

        Cecile




Re: [GENERAL] how to use pg-connect ?

From
Sarah Officer
Date:
I would like more info about the pgtcl commands, too.  In the
"Integrated Document" on the postgres web page, there's a list of
commands (chapter 49), but not detailed information.  When I enter
pgtclsh, I can get a list of options.  For pg_connect, I get this:

% pg_connect
pg_connect: database name missing
pg_connect databaseName [-host hostName] [-port portNumber] [-tty
pgtty]]
pg_connect -conninfo <conninfo-string>

This is fairly intuitive, but the pg_result command isn't as
obvious:
% pg_result
Wrong # of arguments
pg_result result ?option? where option is
        -status
        -error
        -conn
        -oid
        -numTuples
        -numAttrs
        -assign arrayVarName
        -assignbyidx arrayVarName ?appendstr?
        -getTuple tupleNumber
        -tupleArray tupleNumber arrayVarName
        -attributes
        -lAttributes
        -clear

Is there a description of these options in one of the other
documents?

Sarah Officer
officers@aries.tucson.saic.com

Cécile DESNOYERS wrote:
>
> Hello,
>
>         I'd like to know if there is a way to use pg_connect() with a
> different host than « localhost ».
>         I tried to put an IP address or a server name but it didn't work. Has
> anybody ever used pg_connect with something else than localhost ?
>
>         Thank you
>
>                 Cecile
>
> ************