Make & Install contrib/tablefunc Problems

Поиск
Список
Период
Сортировка
Искать

Make & Install contrib/tablefunc Problems

От:
Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>
Дата:
Вложения:
Hi there,

I deleted involuntarily my tablefunc functions in my database. Now, I  
am trying to get them back into it again. But without success.

I am running Mac OS X, 10.5, with postgres 8.3.1 and have used the  
Kyngchaos packages. It seems to me that before I succeeded in doing  
this from within the postgres-package/contrib/tablefunc:

	export PATH="/usr/local/pgsql/bin:$PATH"
	export USE_PGXS=1
	make
	sudo make install

But when I do this I get this error message:

	Makefile:17: ../../src/Makefile.global: No such file or directory
	Makefile:18: /contrib/contrib-global.mk: No such file or directory
	make: *** No rule to make target `/contrib/contrib-global.mk'.  Stop.

What is the problem? What can/should I do?

Thanks for any tipps!

Stef

Re: Make & Install contrib/tablefunc Problems

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Stefan Schwarzer  writes:
> I deleted involuntarily my tablefunc functions in my database. Now, I  
> am trying to get them back into it again. But without success.

> I am running Mac OS X, 10.5, with postgres 8.3.1 and have used the  
> Kyngchaos packages. It seems to me that before I succeeded in doing  
> this from within the postgres-package/contrib/tablefunc:

> 	export PATH="/usr/local/pgsql/bin:$PATH"
> 	export USE_PGXS=1
> 	make
> 	sudo make install

> But when I do this I get this error message:

> 	Makefile:17: ../../src/Makefile.global: No such file or directory
> 	Makefile:18: /contrib/contrib-global.mk: No such file or directory
> 	make: *** No rule to make target `/contrib/contrib-global.mk'.  Stop.

> What is the problem? What can/should I do?

You need to re-run configure in the top level of the distribution tree.
Be sure to use the same configure flags as before (pg_config will remind
you what they were).

			regards, tom lane

Re: Make & Install contrib/tablefunc Problems

От:
Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>
Дата:
Вложения:
>> But when I do this I get this error message:
>
>> 	Makefile:17: ../../src/Makefile.global: No such file or directory
>> 	Makefile:18: /contrib/contrib-global.mk: No such file or directory
>> 	make: *** No rule to make target `/contrib/contrib-global.mk'.   
>> Stop.
>
>> What is the problem? What can/should I do?
>
> You need to re-run configure in the top level of the distribution  
> tree.
> Be sure to use the same configure flags as before (pg_config will  
> remind
> you what they were).

Thanks a lot for the quick reaction. Did this, but now - I am not  
really strong in postgres management - I get this:

	$ psql -U xxx my_database < tablefunc.sql
	SET
	ERROR:  permission denied for language c

Guess I'd need to do this as/with postgres user/role. But really not  
sure how this goes. Thought it should be something like this:

	sudo su - postgres -c '/usr/local/pgsql/bin/pgsql' < tablefunc.sql

But that's no correct.

Thanks for any advice.

Re: Make & Install contrib/tablefunc Problems

От:
Sam Mason <sam@samason.me.uk>
Дата:
On Mon, Jan 25, 2010 at 04:05:57PM +0100, Stefan Schwarzer wrote:
> Guess I'd need to do this as/with postgres user/role.

Yup, or at least somebody with superuser rights.  Try "\du" in psql.

> But really not  
> sure how this goes. Thought it should be something like this:
> 
> 	sudo su - postgres -c '/usr/local/pgsql/bin/pgsql' < tablefunc.sql
> 
> But that's no correct.

Looks about right, what do you get back?

The following does basically the same thing, but I find it a bit easier
to follow:

  sudo -u postgres /usr/local/pgsql/bin/pgsql < tablefunc.sql

-- 
  Sam  http://samason.me.uk/

Re: Make & Install contrib/tablefunc Problems

От:
Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>
Дата:
Вложения:

> The following does basically the same thing, but I find it a bit  
> easier
> to follow:
>
>  sudo -u postgres /usr/local/pgsql/bin/pgsql < tablefunc.sql

Thanks for that. Looks indeed less complicated! :-)

But not yet success for me:

I did re-start, just to be sure.

for postgres:
	./configure (with parameters)
	make

for tablefunc:
	make
	sudo make install

and then:
	sudo -u postgres /usr/local/pgsql/bin/psql -d geodataportal < contrib/ 
tablefunc/tablefunc.sql
	could not identify current directory: Permission denied
	could not identify current directory: Permission denied
	SET
	ERROR:  could not load library "/usr/local/pgsql/lib/tablefunc.so":  
dlopen(/usr/local/pgsql/lib/tablefunc.so, 10): no suitable image  
found.  Did find:
		/usr/local/pgsql/lib/tablefunc.so: mach-o, but wrong architecture
	ERROR:  could not load library "/usr/local/pgsql/lib/tablefunc.so":  
dlopen(/usr/local/pgsql/lib/tablefunc.so, 10): no suitable image  
found.  Did find:
		/usr/local/pgsql/lib/tablefunc.so: mach-o, but wrong architecture
	ERROR:  relation "tablefunc_crosstab_2" already exists
	ERROR:  relation "tablefunc_crosstab_3" already exists
	ERROR:  relation "tablefunc_crosstab_4" already exists
	ERROR:  could not load library "/usr/local/pgsql/lib/tablefunc.so":  
dlopen(/usr/local/pgsql/lib/tablefunc.so, 10): no suitable image  
found.  Did find:
		/usr/local/pgsql/lib/tablefunc.so: mach-o, but wrong architecture
	ERROR:  could not load library "/usr/local/pgsql/lib/tablefunc.so":  
dlopen(/usr/local/pgsql/lib/tablefunc.so, 10): no suitable image  
found.  Did find:
		/usr/local/pgsql/lib/tablefunc.so: mach-o, but wrong architecture
	ERROR:  could not load library "/usr/local/pgsql/lib/tablefunc.so":  
dlopen(/usr/local/pgsql/lib/tablefunc.so, 10): no suitable image  
found.  Did find:
		/usr/local/pgsql/lib/tablefunc.so: mach-o, but wrong architecture
	ERROR:  could not load library "/usr/local/pgsql/lib/tablefunc.so":  
dlopen(/usr/local/pgsql/lib/tablefunc.so, 10): no suitable image  
found.  Did find:
		/usr/local/pgsql/lib/tablefunc.so: mach-o, but wrong architecture
	ERROR:  could not load library "/usr/local/pgsql/lib/tablefunc.so":  
dlopen(/usr/local/pgsql/lib/tablefunc.so, 10): no suitable image  
found.  Did find:
		/usr/local/pgsql/lib/tablefunc.so: mach-o, but wrong architecture
	ERROR:  could not load library "/usr/local/pgsql/lib/tablefunc.so":  
dlopen(/usr/local/pgsql/lib/tablefunc.so, 10): no suitable image  
found.  Did find:
		/usr/local/pgsql/lib/tablefunc.so: mach-o, but wrong architecture
	ERROR:  could not load library "/usr/local/pgsql/lib/tablefunc.so":  
dlopen(/usr/local/pgsql/lib/tablefunc.so, 10): no suitable image  
found.  Did find:
		/usr/local/pgsql/lib/tablefunc.so: mach-o, but wrong architecture
	ERROR:  could not load library "/usr/local/pgsql/lib/tablefunc.so":  
dlopen(/usr/local/pgsql/lib/tablefunc.so, 10): no suitable image  
found.  Did find:
		/usr/local/pgsql/lib/tablefunc.so: mach-o, but wrong architecture
	ERROR:  could not load library "/usr/local/pgsql/lib/tablefunc.so":  
dlopen(/usr/local/pgsql/lib/tablefunc.so, 10): no suitable image  
found.  Did find:
		/usr/local/pgsql/lib/tablefunc.so: mach-o, but wrong architecture

Besides the fact that I have no idea what is going on, if I look  
through my database as indicated (-d geodataportal) I don't see any  
"table_func" functions.

Thanks for any help.

Re: Make & Install contrib/tablefunc Problems

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Stefan Schwarzer  writes:
> 	ERROR:  could not load library "/usr/local/pgsql/lib/tablefunc.so":  
> dlopen(/usr/local/pgsql/lib/tablefunc.so, 10): no suitable image  
> found.  Did find:
> 		/usr/local/pgsql/lib/tablefunc.so: mach-o, but wrong architecture

That's very curious.  Apparently you managed to build a .so of the wrong
machine architecture (ppc vs x86 vs x86_64).  I would guess that you are
using somebody else's build of Postgres and didn't manage to duplicate
their configuration completely.  Now, if it is somebody else's build,
they really should have provided the contrib modules too ... so why
didn't you just grab tablefunc from their distribution?

			regards, tom lane
FAQ