[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] Postgis doesn't work after search_path
From:       Ben Madin <ben () ausvet ! com ! au>
Date:       2015-08-05 8:00:47
Message-ID: CA+weYr0_cJ7XBc_hRDGqSaUxOnjXQNamJP_GR1nkR059qcx8KA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

I don't want to burst your bubble, but I think it would pay to take a
little bit longer to work out what the search_path means and why it didn't
work. It will save you great pain and tears in the future.

cheers

Ben

On 4 August 2015 at 16:07, franco base <frenk.calza@gmail.com> wrote:

> Hi Sandro,
> Your select returns public (8 rows).
> But i just solved restarting the server.
>
> Thanks a lot.
>
> FB
>
>
>
>
> 2015-08-04 9:56 GMT+02:00 Sandro Santilli <strk@keybit.net>:
>
>> On Tue, Aug 04, 2015 at 09:21:56AM +0200, franco base wrote:
>> > Postgis is in Public Schema
>> >
>> > I run
>> > ALTER DATABASE mydb SET search_path TO 'test'
>> >
>> > After Postgis doesn't work
>>
>> This is expected.
>>
>> > So I give this command
>> > reset search_path
>> >
>> > and then
>> > alter database mydb set search_path = "$user", public, topology
>> >
>> > This select:
>> > SELECT r.rolname, d.datname, rs.setconfig
>> > FROM   pg_db_role_setting rs
>> > LEFT   JOIN pg_roles      r ON r.oid = rs.setrole
>> > LEFT   JOIN pg_database   d ON d.oid = rs.setdatabase
>> >
>> > show that mydb is now ok and the setconfig is the same for all the db:
>> > "{"search_path=\"$user\", public, topology"}"
>> >
>> >
>> > On the other db Postgis is ok but on 'mydb' postgis doesn't work again.
>> > This is the error (it's the same for all postgis function):
>> >
>> > ERROR:  function st_union(public.geometry) does not exist
>> > LINE 33: select st_union(wkb_geometry) AS wkb_geometry
>> >
>> > Have you any tips?
>>
>> show search_path;
>> select n.nspname from pg_namespace n, pg_proc p where p.proname =
>> 'st_union' and n.oid = p.pronamespace;
>>
>> --strk;
>>
>>   ()   Free GIS & Flash consultant/developer
>>   /\   http://strk.keybit.net/services.html
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users@lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>



-- 

Ben Madin
BVMS PhD, MANZCVS

t : +61 8 6102 5535
m : +61 448 887 220
e : ben@ausvet.com.au

AusVet Animal Health Services
Western Australia

www.ausvet.com.au

[Attachment #5 (text/html)]

<div dir="ltr">Hi,<div><br></div><div>I don&#39;t want to burst your bubble, but I \
think it would pay to take a little bit longer to work out what the search_path means \
and why it didn&#39;t work. It will save you great pain and tears in the future.  \
</div><div><br></div><div>cheers</div><div><br></div><div>Ben</div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On 4 August 2015 at 16:07, franco \
base <span dir="ltr">&lt;<a href="mailto:frenk.calza@gmail.com" \
target="_blank">frenk.calza@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Hi Sandro,<div>Your select returns public (8 \
rows).</div><div>But i just solved restarting the server.<div><br></div><div>Thanks a \
lot.</div><span class="HOEnZb"><font \
color="#888888"><div><br></div><div>FB</div><div><br><div><span \
style="font-size:12.8000001907349px"><br></span></div><div><span \
style="font-size:12.8000001907349px"><br></span></div></div></font></span></div></div><div \
class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div \
class="gmail_quote">2015-08-04 9:56 GMT+02:00 Sandro Santilli <span dir="ltr">&lt;<a \
href="mailto:strk@keybit.net" \
target="_blank">strk@keybit.net</a>&gt;</span>:<br><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Tue, \
Aug 04, 2015 at 09:21:56AM +0200, franco base wrote:<br> &gt; Postgis is in Public \
Schema<br> &gt;<br>
&gt; I run<br>
&gt; ALTER DATABASE mydb SET search_path TO &#39;test&#39;<br>
&gt;<br>
&gt; After Postgis doesn&#39;t work<br>
<br>
</span>This is expected.<br>
<span><br>
&gt; So I give this command<br>
&gt; reset search_path<br>
&gt;<br>
&gt; and then<br>
&gt; alter database mydb set search_path = &quot;$user&quot;, public, topology<br>
&gt;<br>
&gt; This select:<br>
&gt; SELECT r.rolname, d.datname, rs.setconfig<br>
&gt; FROM     pg_db_role_setting rs<br>
&gt; LEFT     JOIN pg_roles         r ON r.oid = rs.setrole<br>
&gt; LEFT     JOIN pg_database     d ON d.oid = rs.setdatabase<br>
&gt;<br>
&gt; show that mydb is now ok and the setconfig is the same for all the db:<br>
&gt; &quot;{&quot;search_path=\&quot;$user\&quot;, public, topology&quot;}&quot;<br>
&gt;<br>
&gt;<br>
&gt; On the other db Postgis is ok but on &#39;mydb&#39; postgis doesn&#39;t work \
again.<br> &gt; This is the error (it&#39;s the same for all postgis function):<br>
&gt;<br>
&gt; ERROR:   function st_union(public.geometry) does not exist<br>
&gt; LINE 33: select st_union(wkb_geometry) AS wkb_geometry<br>
&gt;<br>
&gt; Have you any tips?<br>
<br>
</span>show search_path;<br>
select n.nspname from pg_namespace n, pg_proc p where p.proname =<br>
&#39;st_union&#39; and n.oid = p.pronamespace;<br>
<br>
--strk;<br>
<br>
   ()     Free GIS &amp; Flash consultant/developer<br>
   /\     <a href="http://strk.keybit.net/services.html" rel="noreferrer" \
target="_blank">http://strk.keybit.net/services.html</a><br> \
_______________________________________________<br> postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" \
target="_blank">postgis-users@lists.osgeo.org</a><br> <a \
href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" rel="noreferrer" \
target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br> \
</blockquote></div><br></div> \
</div></div><br>_______________________________________________<br> postgis-users \
mailing list<br> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
 <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" \
rel="noreferrer" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br><br \
clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><br>Ben \
Madin<div>BVMS PhD, MANZCVS<br><br>t : +61 8 6102 5535<br>m : +61 448 887 220<br>e : \
<a href="mailto:ben@ausvet.com.au" \
target="_blank">ben@ausvet.com.au</a><br><br>AusVet Animal Health Services<br>Western \
Australia<br><br><a href="http://www.ausvet.com.au/" \
target="_blank">www.ausvet.com.au</a><br></div></div></div> </div>



_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic