Unix Technical Forum

question about connection settings

This is a discussion on question about connection settings within the pgsql Interfaces Pgadmin Support forums, part of the PostgreSQL category; --> Hi, all I tried to use "set search_path to x1, x2, public" for postgreSQL when doing a connection. After ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces Pgadmin Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 08:04 PM
Jack
 
Posts: n/a
Default question about connection settings

Hi, all

I tried to use "set search_path to x1, x2, public" for postgreSQL when doing a connection. After that, I won't specify schema for any database object in sql, or plpgsql for postgreSQL will search it by the order I set at the connection. While with pgAdmin, I can't find such a connection settings which I can do "set seach_path". If I open an sql window to do it, the pgAdmin didn't get the search path. It seems every sql window has its own connection. Is that possible to let sql window use the same connection with the pgAdmin? Thank you jin advance!



Jack

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 08:04 PM
Dave Page
 
Posts: n/a
Default Re: question about connection settings

Jack wrote:
> Hi, all
>
> I tried to use "set search_path to x1, x2, public" for postgreSQL
> when doing a connection. After that, I won't specify schema for
> any database object in sql, or plpgsql for postgreSQL will search it by
> the order I set at the connection. While with pgAdmin, I can't find such
> a connection settings which I can do "set seach_path". If I open an sql
> window to do it, the pgAdmin didn't get the search path. It seems every
> sql window has its own connection. Is that possible to let sql window
> use the same connection with the pgAdmin? Thank you jin advance!


No, thats not possible, nor is is ever likely to be (consider what would
happen if you started browsing objects in the treeview whilst a long
running query was executing).

You could just set the search_path as the first query in the query tool,
or as a parameter of your user account.

Regards, Dave

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 08:04 PM
Guillaume Lelarge
 
Posts: n/a
Default Re: question about connection settings

Dave Page a écrit :
> Jack wrote:
>> Hi, all
>>
>> I tried to use "set search_path to x1, x2, public" for postgreSQL
>> when doing a connection. After that, I won't specify schema for
>> any database object in sql, or plpgsql for postgreSQL will search it by
>> the order I set at the connection. While with pgAdmin, I can't find such
>> a connection settings which I can do "set seach_path". If I open an sql
>> window to do it, the pgAdmin didn't get the search path. It seems every
>> sql window has its own connection. Is that possible to let sql window
>> use the same connection with the pgAdmin? Thank you jin advance!

>
> No, thats not possible, nor is is ever likely to be (consider what would
> happen if you started browsing objects in the treeview whilst a long
> running query was executing).
>
> You could just set the search_path as the first query in the query tool,
> or as a parameter of your user account.
>


You can set it on the database you connect to (with ALTER DATABASE mydb
SET search_path TO ...) or on the user you use to connect to the
database (with ALTER USER myuser SET search_path TO ...).

With pgAdmin 1.8, you can also use the new Macros feature which allows
you to bind a key to a SQL macro. Whenever you will hit this key in the
query tool, the recorded query will be sent.

Regards.


--
Guillaume.
<!-- http://abs.traduc.org/
http://lfs.traduc.org/
http://docs.postgresqlfr.org/ -->

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-17-2008, 08:05 PM
Qulas Jack
 
Posts: n/a
Default Re: question about connection settings

Guillaume,

Thank you very much! I would like to use a macro to do set search_path,
because the whole database will become in that search order when I do alter
database. But there is still a problem when writing a new function and using
either %TYPE or %ROWTYPE, postgreSQL will check whether the table exists
immediately.

Jack

----- Original Message -----
From: "Guillaume Lelarge" <guillaume@lelarge.info>
To: "Dave Page" <dpage@postgresql.org>
Cc: "Jack" <quals.jack@gmail.com>; <pgadmin-support@postgresql.org>
Sent: Wednesday, August 01, 2007 5:49 PM
Subject: Re: [pgadmin-support] question about connection settings


> Dave Page a écrit :
>> Jack wrote:
>>> Hi, all
>>>
>>> I tried to use "set search_path to x1, x2, public" for postgreSQL
>>> when doing a connection. After that, I won't specify schema for
>>> any database object in sql, or plpgsql for postgreSQL will search it by
>>> the order I set at the connection. While with pgAdmin, I can't find such
>>> a connection settings which I can do "set seach_path". If I open an sql
>>> window to do it, the pgAdmin didn't get the search path. It seems every
>>> sql window has its own connection. Is that possible to let sql window
>>> use the same connection with the pgAdmin? Thank you jin advance!

>>
>> No, thats not possible, nor is is ever likely to be (consider what would
>> happen if you started browsing objects in the treeview whilst a long
>> running query was executing).
>>
>> You could just set the search_path as the first query in the query tool,
>> or as a parameter of your user account.
>>

>
> You can set it on the database you connect to (with ALTER DATABASE mydb
> SET search_path TO ...) or on the user you use to connect to the
> database (with ALTER USER myuser SET search_path TO ...).
>
> With pgAdmin 1.8, you can also use the new Macros feature which allows
> you to bind a key to a . Whenever you will hit this key in the
> query tool, the recorded query will be sent.
>
> Regards.
>
>
> --
> Guillaume.
> <!-- http://abs.traduc.org/
> http://lfs.traduc.org/
> http://docs.postgresqlfr.org/ -->



---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:38 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com