play with current schema
От | Andro |
---|---|
Тема | play with current schema |
Дата | |
Msg-id | da7021e0610160858o1605eed8tf546cfea72994d85@mail.gmail.com обсуждение исходный текст |
Список | pgsql-interfaces |
Hi,<br /><br />this may not be the right place to address this question but I've already subscribed on this list.<br /><br/>I'm connected as user "def" and here's what happens while modifying current_schema - i.e. search_path var : <br /><br/>##########<br />db=> \dn<br /> List of schemas<br /> Name | Owner <br />--------------------+---------<br/> abc | abc<br />[...]<br />db=> select current_schema();<br /> current_schema<br />----------------<br /> public<br />(1 row)<br />db=> show search_path ;<br /> search_path <br/>--------------<br /> $user,public<br />(1 row)<br /><br />db=> SET search_path TO abc;<br />SET<br />db=> selectcurrent_schema();<br /> current_schema <br />----------------<br /> <br />(1 row)<br /><br />db=> show search_path;<br /> search_path <br />-------------<br /> abc<br />(1 row)<br />###########<br /><br />Trying to change thecurrent schema to a _not owned_ schema will _not_ raise any error and result in this 'misbehaviour' between the two commandsshowing the current schema. <br />select current_schema() will return NULL ...<br />Did I miss something or everything'snormal here?<br /><br />Isn't it supposed to raise an error or succeed and then the two commands would displaythe same?<br />However, what's the difference between those two commands except that the latter is a variable andthe former will pick up stuff from catalog's table? <br /><br />Thanks for help<br /><br />Charles<br />
В списке pgsql-interfaces по дате отправления: