Thread: pg_wrapper error

pg_wrapper error

From
José Pedro Santos
Date:
Dear all,

When I try to use the command line tool shp2pgsql in the shell I have this error:

Error: pg_wrapper: invalid command name

I already read some information in the Debian lists but I don't understand the problem/relation with PostgreSQL.

If anyone can help me with this problem please tell me.

Many thanks
José Santos

Re: pg_wrapper error

From
Adrian Klaver
Date:
On 10/26/2012 06:16 AM, José Pedro Santos wrote:
> Dear all,
>
> When I try to use the command line tool shp2pgsql in the shell I have
> this error:
>
> *Error: pg_wrapper: invalid command name*
>
> I already read some information in the Debian lists but I don't
> understand the problem/relation with PostgreSQL.
>
> If anyone can help me with this problem please tell me.

More information is needed.

What version of Postgres?

What OS and version?

How are you using shp2pgsql?
    In other words show command line.

Where is the above error showing up?

>
> Many thanks
> José Santos


--
Adrian Klaver
adrian.klaver@gmail.com


Re: pg_wrapper error

From
José Pedro Santos
Date:
Postgres 9.1 in Ubuntu Distribution (12.04 LTS).

When I try to use the shp2pgsql after the pg_wrapper error said that I don't have that function, so I enable that function with this command:

sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/shp2pgsql

then I try to import again with the same expression that I used before:

shp2pgsql /home/user/Downloads/Africa_Boundaries/africa.shp teste2.africa | psql -d MyDatabase
And I have the pg_wrapper error (Error: pg_wrapper: invalid command name)


Many thanks
José Santos


> Date: Fri, 26 Oct 2012 06:24:18 -0700
> From: adrian.klaver@gmail.com
> To: zpsantos1@hotmail.com
> CC: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] pg_wrapper error
>
> On 10/26/2012 06:16 AM, José Pedro Santos wrote:
> > Dear all,
> >
> > When I try to use the command line tool shp2pgsql in the shell I have
> > this error:
> >
> > *Error: pg_wrapper: invalid command name*
> >
> > I already read some information in the Debian lists but I don't
> > understand the problem/relation with PostgreSQL.
> >
> > If anyone can help me with this problem please tell me.
>
> More information is needed.
>
> What version of Postgres?
>
> What OS and version?
>
> How are you using shp2pgsql?
> In other words show command line.
>
> Where is the above error showing up?
>
> >
> > Many thanks
> > José Santos
>
>
> --
> Adrian Klaver
> adrian.klaver@gmail.com

FW: pg_wrapper error

From
José Pedro Santos
Date:

Postgres 9.1 in Ubuntu Distribution (12.04 LTS).

When I try to use the shp2pgsql, BEFORE the pg_wrapper error, said that I don't have that function, so I enable that function with this command:

sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/shp2pgsql

then I try to import again with the same expression that I used before:

shp2pgsql /home/user/Downloads/Africa_Boundaries/africa.shp teste2.africa | psql -d MyDatabase
And I have the pg_wrapper error (Error: pg_wrapper: invalid command name)


Many thanks
José Santos


> Date: Fri, 26 Oct 2012 06:24:18 -0700
> From: adrian.klaver@gmail.com
> To: zpsantos1@hotmail.com
> CC: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] pg_wrapper error
>
> On 10/26/2012 06:16 AM, José Pedro Santos wrote:
> > Dear all,
> >
> > When I try to use the command line tool shp2pgsql in the shell I have
> > this error:
> >
> > *Error: pg_wrapper: invalid command name*
> >
> > I already read some information in the Debian lists but I don't
> > understand the problem/relation with PostgreSQL.
> >
> > If anyone can help me with this problem please tell me.
>
> More information is needed.
>
> What version of Postgres?
>
> What OS and version?
>
> How are you using shp2pgsql?
> In other words show command line.
>
> Where is the above error showing up?
>
> >
> > Many thanks
> > José Santos
>
>
> --
> Adrian Klaver
> adrian.klaver@gmail.com

Re: pg_wrapper error

From
Adrian Klaver
Date:
On 10/26/2012 06:33 AM, José Pedro Santos wrote:
> Postgres 9.1 in Ubuntu Distribution (12.04 LTS).
>
> When I try to use the shp2pgsql after the pg_wrapper error said that I
> don't have that function, so I enable that function with this command:
>
> sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/shp2pgsql

In the above you just made shp2pgsql = pg_wrapper. In your case you
should really not have to worry about pg_wrapper. Undo the symlink.

For more info on what pg_wrapper really is:
http://manpages.ubuntu.com/manpages/lucid/man1/pg_wrapper.1.html
>

>
> then I try to import again with the same expression that I used before:
>
> shp2pgsql /home/user/Downloads/Africa_Boundaries/africa.shp teste2.africa | psql -d MyDatabase
>
> And I have the pg_wrapper error (Error: pg_wrapper: invalid command name)

You are getting the above because you made shp2pgsl = pg_wrapper.

>
>
> Many thanks
> José Santos
>



--
Adrian Klaver
adrian.klaver@gmail.com


Re: pg_wrapper error

From
"Kevin Grittner"
Date:
José Pedro Santos wrote:

> When I try to use the command line tool shp2pgsql in the shell I
> have this error:
>
> Error: pg_wrapper: invalid command name
>
> I already read some information in the Debian lists but I don't
> understand the problem/relation with PostgreSQL.

shp2pgsql converts ESRI Shape files into SQL suitable for insertion
into a PostGIS/PostgreSQL database. You are not using PostgreSQL
until you take the resulting file and run it against the database
using some client application, like psql. pg_wrapper is an Ubuntu
"helper" program that runs a PostgreSQL client program like psql
after looking up which version to use for the requested database
cluster.

http://manpages.ubuntu.com/manpages/lucid/man1/shp2pgsql.1.html

http://manpages.ubuntu.com/manpages/lucid/man1/pg_wrapper.1.html

It appears that you don't have pg_wrapper installed, but are trying
to use it (either directly or by running something which tries to use
it).

-Kevin


Re: pg_wrapper error

From
José Pedro Santos
Date:
HI,

I only made that to enable the shp2pqsql but don't work well... (I read in one website). The problem if I don't had made that I have one error saying that I don't have that package (I' m using Postgis 2.0)...

how  can undo the operation?

Thanks!
JSantos

> Date: Fri, 26 Oct 2012 06:56:46 -0700
> From: adrian.klaver@gmail.com
> To: zpsantos1@hotmail.com
> CC: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] pg_wrapper error
>
> On 10/26/2012 06:33 AM, José Pedro Santos wrote:
> > Postgres 9.1 in Ubuntu Distribution (12.04 LTS).
> >
> > When I try to use the shp2pgsql after the pg_wrapper error said that I
> > don't have that function, so I enable that function with this command:
> >
> > sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/shp2pgsql
>
> In the above you just made shp2pgsql = pg_wrapper. In your case you
> should really not have to worry about pg_wrapper. Undo the symlink.
>
> For more info on what pg_wrapper really is:
> http://manpages.ubuntu.com/manpages/lucid/man1/pg_wrapper.1.html
> >
>
> >
> > then I try to import again with the same expression that I used before:
> >
> > shp2pgsql /home/user/Downloads/Africa_Boundaries/africa.shp teste2.africa | psql -d MyDatabase
> >
> > And I have the pg_wrapper error (Error: pg_wrapper: invalid command name)
>
> You are getting the above because you made shp2pgsl = pg_wrapper.
>
> >
> >
> > Many thanks
> > José Santos
> >
>
>
>
> --
> Adrian Klaver
> adrian.klaver@gmail.com
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

Re: pg_wrapper error

From
Lee Hachadoorian
Date:
On Fri, Oct 26, 2012 at 9:37 AM, Kevin Grittner <kgrittn@mail.com> wrote:
> José Pedro Santos wrote:
>
>> When I try to use the command line tool shp2pgsql in the shell I
>> have this error:
>>
>> Error: pg_wrapper: invalid command name
>>
>> I already read some information in the Debian lists but I don't
>> understand the problem/relation with PostgreSQL.
>
> shp2pgsql converts ESRI Shape files into SQL suitable for insertion
> into a PostGIS/PostgreSQL database. You are not using PostgreSQL
> until you take the resulting file and run it against the database
> using some client application, like psql. pg_wrapper is an Ubuntu
> "helper" program that runs a PostgreSQL client program like psql
> after looking up which version to use for the requested database
> cluster.
>
> http://manpages.ubuntu.com/manpages/lucid/man1/shp2pgsql.1.html
>
> http://manpages.ubuntu.com/manpages/lucid/man1/pg_wrapper.1.html
>
> It appears that you don't have pg_wrapper installed, but are trying
> to use it (either directly or by running something which tries to use
> it).
>
> -Kevin

No, pg_wrapper is installed. If it weren't, you would get

    pg_wrapper: command not found

The issue is that it seems raster2pgsql and shp2pgsql are not
installed. You cannnot "enable" them by making them each a link to
pg_wrapper.

You might want to bring this back to the PostGIS list, because I think
this is a problem of an incorrect PostGIS installation.

--Lee

--
Lee Hachadoorian
Asst Professor of Geography, Dartmouth College
http://freecity.commons.gc.cuny.edu/