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

List:       postgis-users
Subject:    Re: [postgis-users] Creating a template for postgis-enabled	databases?
From:       Chander Ganesan <chander () otg-nc ! com>
Date:       2007-12-18 12:40:56
Message-ID: 4767BFD8.9020305 () otg-nc ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Sebastien ARBOGAST wrote:
> I still have one problem with this procedure. The owner of
> template_postgis is the user with which I created it, in this case
> postgres. And when I create a new database based on this template,
> both geometry_columns and spatial_ref_sys have their owner set to
> postgres instead of the owner of the new database.
>   
When you create a database, the database itself is owned by the user 
that issued the create database command....if that user was 'postgres', 
then he/she would own the database.  If you look at the syntax of the 
create database command, they you'll see how you can set the owner of a 
DB when you create the DB.  However, I suspect that isn't your problem.

Instead, I think that you have a schema or other objects in the 
'template_postgis' database that is owned by the user 'postgres'.  That 
schema, along with any other permissions *inside* the database are 
copied "as is" when creating a new database (regardless of the database 
owner).   As such, you should change the ownership of the schema so that 
it's owned by the appropriate user (the same would go for any tables, 
indexes, etc. inside the database that you want owned by someone else).

I recommend you check out the online help for 'ALTER SCHEMA', 'ALTER 
TABLE', 'ALTER SEQUENCE', and the other related commands to see how to 
change the ownership of the objects you want to change.

Hope that helps.

Chander
> Is it normal? Is there a way to change that?
>
> 2007/12/16, Sebastien ARBOGAST <sebastien.arbogast@gmail.com>:
>   
>> Yes! That worked great. Thanks to both of you.
>>
>> 2007/12/16, LuVar <varga.lubomir@orangemail.sk>:
>>     
>>> Jop. I get also the same. Just try to disconnect in pgAdmin and
>>> reconnect. Than click ONLY on that database, in which you want to do
>>> somethink. Dont open "template_postgis" table. You must have an red
>>> cross iccon on "template_postgis" database.
>>>
>>> Try, and good luck.
>>>
>>> Sunday, December 16, 2007, 3:25:11 PM, you wrote:
>>>
>>>       
>>>> I just did that and I can't create a database based on template_postgis.
>>>>         
>>>> When I try to do it via pgAdmin, I get a message saying that "Source
>>>> database "template_postgis" is being accessed by other users
>>>>         
>>>> When I try to run the command in terminal, I get the following message:
>>>>         
>>>> createdb: could not connect to database template1: could not translate
>>>> host name "tagspot_local" to address: nodename nor servname provided,
>>>> or not known
>>>>         
>>>
>>>       
>>>> 2007/12/16, Shoaib Burq <shoaib@nomad-labs.com>:
>>>>         
>>>>> Sebastian, please see:
>>>>> http://geospatial.nomad-labs.com/2007/12/16/template-postgis-database/
>>>>> shoaib
>>>>>
>>>>>
>>>>>  On Dec 16, 2007 10:15 AM, Sebastien ARBOGAST <sebastien.arbogast@gmail.com>
>>>>> wrote:
>>>>>           
>>>>>> Hi,
>>>>>>
>>>>>> I've just installed postgresql 8.2.5 and postgis 1.3.2 on my mac and
>>>>>> everything works great so far. Now I'm just looking for a way to
>>>>>> simplify the creation of postgis-enabled databases in pgAdmin.
>>>>>> I saw that in the Windows distribution, there is a template to do so,
>>>>>> but there is no such template in my installation. Knowing that it's
>>>>>> the first time that I use postgresql and postgis, is there a way to
>>>>>> create such a template?
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Sébastien Arbogast
>>>>>>
>>>>>> http://www.sebastien-arbogast.com
>>>>>> _______________________________________________
>>>>>> postgis-users mailing list
>>>>>> postgis-users@postgis.refractions.net
>>>>>>
>>>>>>             
>>>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>>>           
>>>>>           
>>>
>>>
>>> --
>>> Best regards,
>>>  LuVar                            mailto:varga.lubomir@orangemail.sk
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users@postgis.refractions.net
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>
>>>       
>> --
>> Sébastien Arbogast
>>
>> http://www.sebastien-arbogast.com
>>
>>     
>
>
>   


-- 
Chander Ganesan
The Open Technology Group
One Copley Parkway, Suite 210
Morrisville, NC  27560
Phone: 877-258-8987/919-463-0999
http://www.otg-nc.com


[Attachment #5 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Sebastien ARBOGAST wrote:
<blockquote
 cite="mid:a753b7f80712171452xa0071ecqc35f2e89ab95c7a0@mail.gmail.com"
 type="cite">
  <pre wrap="">I still have one problem with this procedure. The owner of
template_postgis is the user with which I created it, in this case
postgres. And when I create a new database based on this template,
both geometry_columns and spatial_ref_sys have their owner set to
postgres instead of the owner of the new database.
  </pre>
</blockquote>
When you create a database, the database itself is owned by the user
that issued the create database command....if that user was 'postgres',
then he/she would own the database.&nbsp; If you look at the syntax of the
create database command, they you'll see how you can set the owner of a
DB when you create the DB.&nbsp; However, I suspect that isn't your problem.<br>
<br>
Instead, I think that you have a schema or other objects in the
'template_postgis' database that is owned by the user 'postgres'.&nbsp; That
schema, along with any other permissions *inside* the database are
copied "as is" when creating a new database (regardless of the database
owner).&nbsp;&nbsp; As such, you should change the ownership of the schema so
that it's owned by the appropriate user (the same would go for any
tables, indexes, etc. inside the database that you want owned by
someone else).<br>
<br>
I recommend you check out the online help for 'ALTER SCHEMA', 'ALTER
TABLE', 'ALTER SEQUENCE', and the other related commands to see how to
change the ownership of the objects you want to change.<br>
<br>
Hope that helps.<br>
<br>
Chander<br>
<blockquote
 cite="mid:a753b7f80712171452xa0071ecqc35f2e89ab95c7a0@mail.gmail.com"
 type="cite">
  <pre wrap="">
Is it normal? Is there a way to change that?

2007/12/16, Sebastien ARBOGAST <a class="moz-txt-link-rfc2396E" \
href="mailto:sebastien.arbogast@gmail.com">&lt;sebastien.arbogast@gmail.com&gt;</a>:  \
</pre>  <blockquote type="cite">
    <pre wrap="">Yes! That worked great. Thanks to both of you.

2007/12/16, LuVar <a class="moz-txt-link-rfc2396E" \
href="mailto:varga.lubomir@orangemail.sk">&lt;varga.lubomir@orangemail.sk&gt;</a>:  \
</pre>  <blockquote type="cite">
      <pre wrap="">Jop. I get also the same. Just try to disconnect in pgAdmin and
reconnect. Than click ONLY on that database, in which you want to do
somethink. Dont open "template_postgis" table. You must have an red
cross iccon on "template_postgis" database.

Try, and good luck.

Sunday, December 16, 2007, 3:25:11 PM, you wrote:

      </pre>
      <blockquote type="cite">
        <pre wrap="">I just did that and I can't create a database based on \
template_postgis.  </pre>
      </blockquote>
      <blockquote type="cite">
        <pre wrap="">When I try to do it via pgAdmin, I get a message saying that \
"Source database "template_postgis" is being accessed by other users
        </pre>
      </blockquote>
      <blockquote type="cite">
        <pre wrap="">When I try to run the command in terminal, I get the following \
message:  </pre>
      </blockquote>
      <blockquote type="cite">
        <pre wrap="">createdb: could not connect to database template1: could not \
translate host name "tagspot_local" to address: nodename nor servname provided,
or not known
        </pre>
      </blockquote>
      <pre wrap="">

      </pre>
      <blockquote type="cite">
        <pre wrap="">2007/12/16, Shoaib Burq <a class="moz-txt-link-rfc2396E" \
href="mailto:shoaib@nomad-labs.com">&lt;shoaib@nomad-labs.com&gt;</a>:  </pre>
        <blockquote type="cite">
          <pre wrap="">Sebastian, please see:
<a class="moz-txt-link-freetext" \
href="http://geospatial.nomad-labs.com/2007/12/16/template-postgis-database/">http://geospatial.nomad-labs.com/2007/12/16/template-postgis-database/</a>
 shoaib


 On Dec 16, 2007 10:15 AM, Sebastien ARBOGAST <a class="moz-txt-link-rfc2396E" \
href="mailto:sebastien.arbogast@gmail.com">&lt;sebastien.arbogast@gmail.com&gt;</a> \
wrote:  </pre>
          <blockquote type="cite">
            <pre wrap="">Hi,

I've just installed postgresql 8.2.5 and postgis 1.3.2 on my mac and
everything works great so far. Now I'm just looking for a way to
simplify the creation of postgis-enabled databases in pgAdmin.
I saw that in the Windows distribution, there is a template to do so,
but there is no such template in my installation. Knowing that it's
the first time that I use postgresql and postgis, is there a way to
create such a template?


--
S&eacute;bastien Arbogast

<a class="moz-txt-link-freetext" \
href="http://www.sebastien-arbogast.com">http://www.sebastien-arbogast.com</a> \
_______________________________________________ postgis-users mailing list
<a class="moz-txt-link-abbreviated" \
href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>


            </pre>
          </blockquote>
          <pre wrap=""><a class="moz-txt-link-freetext" \
href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>
  </pre>
          <pre wrap="">
          </pre>
        </blockquote>
      </blockquote>
      <pre wrap="">


--
Best regards,
 LuVar                            <a class="moz-txt-link-freetext" \
href="mailto:varga.lubomir@orangemail.sk">mailto:varga.lubomir@orangemail.sk</a>

_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" \
href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
 <a class="moz-txt-link-freetext" \
href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>


      </pre>
    </blockquote>
    <pre wrap="">
--
S&eacute;bastien Arbogast

<a class="moz-txt-link-freetext" \
href="http://www.sebastien-arbogast.com">http://www.sebastien-arbogast.com</a>

    </pre>
  </blockquote>
  <pre wrap=""><!---->

  </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
Chander Ganesan
The Open Technology Group
One Copley Parkway, Suite 210
Morrisville, NC  27560
Phone: 877-258-8987/919-463-0999
<a class="moz-txt-link-freetext" \
href="http://www.otg-nc.com">http://www.otg-nc.com</a> </pre>
</body>
</html>



_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/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