Re: can I define own variables? - Mailing list pgsql-general

From Martin Gainty
Subject Re: can I define own variables?
Date
Msg-id BAY108-DAV2A3BE5A392046D7B5ABD9AEA20@phx.gbl
Whole thread Raw
In response to Re: can I define own variables?  (Scott Ribe <scott_ribe@killerbytes.com>)
List pgsql-general
Good Evening Andreas-

Windows Control Panel/System/Advanced/EnvironmentVariables/Set System
Variables as mentioned
PGHOST=localhost
all processes for all users will see these env vars

Unix bash (to set system wide variables)
go to /etc/profile
vi .profile

PGHOST=localhost
export PGHOST

:w!
:q

Hope this helps/
Martin--
----- Original Message -----
From: "Andreas" <maps.on@gmx.net>
To: "Martin Gainty" <mgainty@hotmail.com>
Cc: <pgsql-general@postgresql.org>
Sent: Sunday, October 14, 2007 1:30 PM
Subject: Re: [GENERAL] can I define own variables?


> Martin,
>
> Can you explain this a little further?
>
> My client-application would somehow set the the environment-variable
> PGUSER e.g. to 42.
> Then create an odbc connection with user='john' and password='doe' to
> the remote pg-server.
> Later the triggers that run on the server would access this client-local
> environment-variable for updates?
>
> How can the server-located function see client-local Env-Vars ?
>
> Regards
> Andreas
>
>
> Martin Gainty schrieb:
> > http://www.postgresql.org/docs/8.3/static/libpq-envars.html
> > use environment variables
> >
> > PGHOST is the host for Postgres
> > PGHOSTADDR is the Numeric Host Address for Postgres
> > PGPORT is the port for the PostgresServer to listen on
> > PGDATABASE is the default Database Name
> > PGUSER  is the default Username to use to login
> > PGPASSWORD is the password to use for default Username to login
> >
> > M--
> >
> > ----- Original Message -----
> > From: "Scott Ribe" <scott_ribe@killerbytes.com>
> > To: "Andreas" <maps.on@gmx.net>; <pgsql-general@postgresql.org>
> > Sent: Saturday, October 13, 2007 11:05 AM
> > Subject: Re: [GENERAL] can I define own variables?
> >
> >
> >
> >>> can I define connection-global variables within a ODBC connection ?
> >>>
> >> Temp table, containing only 1 row, one column per variable. If you so
> >>
> > wish,
> >
> >> wrap it up in stored procedures for creating, setting, and accessing.
> >>
> >> --
> >> Scott Ribe
> >> scott_ribe@killerbytes.com
> >> http://www.killerbytes.com/
> >> (303) 722-0567 voice
> >>
> >>
> >>
> >> ---------------------------(end of
broadcast)---------------------------
> >> TIP 1: if posting/reading through Usenet, please send an appropriate
> >>        subscribe-nomail command to majordomo@postgresql.org so that
your
> >>        message can get through to the mailing list cleanly
> >>
> >>
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: explain analyze is your friend
> >
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org/
>


pgsql-general by date:

Previous
From: Andreas
Date:
Subject: Re: can I define own variables?
Next
From: Andreas Kretschmer
Date:
Subject: Re: drop table cascade doesn't drop manual sequences