Thread: Installing PostGIS 2.0

Installing PostGIS 2.0

From
James David Smith
Date:
Dear all,

I'm currently running PostgresSQL 8.4 with PostGIS 1.5, but figured
it's about time that I upgraded to a more recent version. I had
decided not to do this until now as I wanted to use PgRouting, but I
see that Sanak has wonderfully made this possible now, so just now I
downloaded and installed PostgresSQL 9.1. This seemed to go well.
However I then launched Stack Builder and asked it to download and
install PostGIS 2.0. Towards the end of this process however I was
given an error which was :

_____
Database installation of PostGIS functions failed
_____


It asked me if I wanted to view the error text, so I did, and it said:

____
ERROR:  syntax error at or near "EXTENSION"
LINE 1: CREATE EXTENSION postgis;
               ^
____

Would someone be able to explain what is going on please? I 'finished'
the installation at this point and can actually see a PostGIS2.0
template in my PostgresSQL 9.1 installation, so actually all has gone
well?

Thanks

James

Re: Installing PostGIS 2.0

From
Tom Lane
Date:
James David Smith <james.david.smith@gmail.com> writes:
> I'm currently running PostgresSQL 8.4 with PostGIS 1.5, but figured
> it's about time that I upgraded to a more recent version. I had
> decided not to do this until now as I wanted to use PgRouting, but I
> see that Sanak has wonderfully made this possible now, so just now I
> downloaded and installed PostgresSQL 9.1. This seemed to go well.
> However I then launched Stack Builder and asked it to download and
> install PostGIS 2.0. Towards the end of this process however I was
> given an error which was :

> ERROR:  syntax error at or near "EXTENSION"
> LINE 1: CREATE EXTENSION postgis;
>                ^

That does not look like you are running a 9.1 server.  You certain
you're not still talking to the 8.4 installation?

            regards, tom lane

Re: Installing PostGIS 2.0

From
James David Smith
Date:
Hi Tom,

I don't think so. I went to the postgresql 9.1 folder and launched
stack builder from there. It then asked me which installation of
postgresql I was launching software for, so I selected 9.1. I then
followed the steps and got this error.

It seems like there is some error with PostGIS already being installed
no? It goes to create a template and finds one there already?

Thanks

James



I note that when I launch pgAdminIII I now have two servers. 8.4 and 9.1.

On 7 June 2012 15:20, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> James David Smith <james.david.smith@gmail.com> writes:
>> I'm currently running PostgresSQL 8.4 with PostGIS 1.5, but figured
>> it's about time that I upgraded to a more recent version. I had
>> decided not to do this until now as I wanted to use PgRouting, but I
>> see that Sanak has wonderfully made this possible now, so just now I
>> downloaded and installed PostgresSQL 9.1. This seemed to go well.
>> However I then launched Stack Builder and asked it to download and
>> install PostGIS 2.0. Towards the end of this process however I was
>> given an error which was :
>
>> ERROR:  syntax error at or near "EXTENSION"
>> LINE 1: CREATE EXTENSION postgis;
>>                ^
>
> That does not look like you are running a 9.1 server.  You certain
> you're not still talking to the 8.4 installation?
>
>                        regards, tom lane

Re: Installing PostGIS 2.0

From
James David Smith
Date:
Hi,

Apologies for another email.

Just thought that I'd say I ran stack builder and tried to install
PostGIS 2.0 into my PostgresSQL 8.4 database and it did it fine. Then
I went into my PostgreSQL 9.1 server and can now see the
template_postgis_20 database. Which I can now use and seems to be
fine. I even enabled PgRouting in it (thanks for the files Sanak). Bit
of an odd method to get PostGIS 2.0 working with 9.1 but it seems to
be working.

Cheers

James





On 7 June 2012 15:46, James David Smith <james.david.smith@gmail.com> wrote:
> Hi all,
>
> I wonder if I need to remove PostGIS 1.5 first? I've attached a screen
> print of my PgAdminIII console incase if it shows anything useful.
>
> Thanks
>
> James
>
> On 7 June 2012 15:27, James David Smith <james.david.smith@gmail.com> wrote:
>> Hi Tom,
>>
>> I don't think so. I went to the postgresql 9.1 folder and launched
>> stack builder from there. It then asked me which installation of
>> postgresql I was launching software for, so I selected 9.1. I then
>> followed the steps and got this error.
>>
>> It seems like there is some error with PostGIS already being installed
>> no? It goes to create a template and finds one there already?
>>
>> Thanks
>>
>> James
>>
>>
>>
>> I note that when I launch pgAdminIII I now have two servers. 8.4 and 9.1.
>>
>> On 7 June 2012 15:20, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> James David Smith <james.david.smith@gmail.com> writes:
>>>> I'm currently running PostgresSQL 8.4 with PostGIS 1.5, but figured
>>>> it's about time that I upgraded to a more recent version. I had
>>>> decided not to do this until now as I wanted to use PgRouting, but I
>>>> see that Sanak has wonderfully made this possible now, so just now I
>>>> downloaded and installed PostgresSQL 9.1. This seemed to go well.
>>>> However I then launched Stack Builder and asked it to download and
>>>> install PostGIS 2.0. Towards the end of this process however I was
>>>> given an error which was :
>>>
>>>> ERROR:  syntax error at or near "EXTENSION"
>>>> LINE 1: CREATE EXTENSION postgis;
>>>>                ^
>>>
>>> That does not look like you are running a 9.1 server.  You certain
>>> you're not still talking to the 8.4 installation?
>>>
>>>                        regards, tom lane

Re: Installing PostGIS 2.0

From
René Romero Benavides
Date:
Am 07.06.2012 09:27, schrieb James David Smith:

I also believe you're talking to the old installation, why don't you stop the 8.4 server and see what happens when you try to install postgis. I bet it will tell you that it couldn't connect to the server.
If so, set your new server (9.1)  to listen to port 5432, restart it and retry the installation process.

Hope it helps you.

Hi Tom,

I don't think so. I went to the postgresql 9.1 folder and launched
stack builder from there. It then asked me which installation of
postgresql I was launching software for, so I selected 9.1. I then
followed the steps and got this error.

It seems like there is some error with PostGIS already being installed
no? It goes to create a template and finds one there already?

Thanks

James



I note that when I launch pgAdminIII I now have two servers. 8.4 and 9.1.

On 7 June 2012 15:20, Tom Lane <tgl@sss.pgh.pa.us> wrote:
James David Smith <james.david.smith@gmail.com> writes:
I'm currently running PostgresSQL 8.4 with PostGIS 1.5, but figured
it's about time that I upgraded to a more recent version. I had
decided not to do this until now as I wanted to use PgRouting, but I
see that Sanak has wonderfully made this possible now, so just now I
downloaded and installed PostgresSQL 9.1. This seemed to go well.
However I then launched Stack Builder and asked it to download and
install PostGIS 2.0. Towards the end of this process however I was
given an error which was :
ERROR:  syntax error at or near "EXTENSION"
LINE 1: CREATE EXTENSION postgis;
               ^
That does not look like you are running a 9.1 server.  You certain
you're not still talking to the 8.4 installation?

                       regards, tom lane