How can I install Trigram module for Postgresql installed through homebrew? - postgresql

So I've installed Postgresql via Homebrew, and it looks like the contrib directory is missing. And all of the tutorials I've read to install Trigram require this.
$ cd /usr/local/Cellar/postgresql/9.1.2/share/postgresql/contrib
-bash: cd: /usr/local/Cellar/postgresql/9.1.2/share/postgresql/contrib: No such file or directory
Can anyone point me in the right direction to get Trigram installed (pg_trgm.sql)? I'm lost here.
Thanks.

Just found out that the correct path is....
/usr/local/Cellar/postgresql/9.1.2/share/postgresql/extension
Wanted to share for anyone else running into this.

I ran the same issue, but found that the correct path is:
/usr/local/Cellar/postgis15/1.5.3/share/postgis/
Of course check out your PostGIS version number to match your exact path. This folder is where files like postgis.sql or spatial_ref_sys.sql are found... I guess this is what you need?

Related

PHP5 - pgsql Module not loaded

I am trying to get work PostgresSQL with PHP, but i stuck on that apache error:
Call to undefined function pg_connect().
When i run phpinfo() i cannot see that my module is loaded, but i do not know why. The pgsql.ini files were loaded. And when i open them, i can see, that the extension is enabled extension=pgsql.so. Under /usr/lib64/php5/extensions there is the .so file. Even the permission are same like the other modules.
Any idea what am I doing wrong?
It would help if you could describe what operating system you are using. I'm assume Linux, but which distribution? One package that is often forgotten when installing postgresql and php is php5-pgsql. This is the connection between the two. For some reason I cannot explain, it is best if all three are installed together. So I suggest uninstalling postgresql and php and then installing postgresql, php5 and php5-pgsql. I hope this works for you!
I found it out. Some libraries where not found.
1.) First of all run php -version
2.) If there is an error where it described that some libraries are missing, you can solve it like me
3.) Search for the files on your system find / -name {LIBRARY NAME}
3a.) If you found them, just create a symlink to /usr/lib64
3b.) If not, find a way to get them and 3 3a

how to uninstall doxygen using make file on Ubuntu (12.04)?

I am using Ubuntu 12.04. I have installed doxygen 1.8.3.1 using make install.
I would like to uninstall the doxygen built by make, but I don't find any way to do it using make (uninstall or clean...).
In the Makefile there is no reference to uninstall it the software. :(
Unfortunately I can't use the sudo apt-get remove doxygen because it wasn't an installed. :(
I don't find anything related on the internet.
Can anyone help me, please?
Thank you in advance,
Fabiola
There is no "uninstall" target. You need to do a "rm" be hand. If you used the standard prefix path "/usr/local" then
rm /usr/local/bin/doxygen
rm /usr/local/man/man.1/doxygen.1
(more if you install the docs are wizard). Depend on the user used for install, you need sudo to do it.
I know this question is old, but since it is the first result in google I would like to share another way of uninstalling Doxygen built from source. In the build directory where you've ran make there should by a file name install_manifest.txt. That file contains paths to files that were installed using make install command. All you need to do is to run the following command:
sudo xargs rm < install_manifest.txt
Of course this assumes that you've kept the build directory or at least the install_manifest.txt file. If not you need to remove the files by hand as somebody already suggested.

Installing Sphinx on Linux VPS

After hours of searching Google and StackOverflow, I haven't been able to resolve this issue...
I'm trying to install Sphinx Search on my VPS, but I have absolutely no idea what I'm doing. All I know is that this search feature is extremely important to my project.
I've tried the following commands in puTTy to unpack the Sphinx tarball:
tar xzvf sphinx-2.0.6-release.tar.gz
tar -xzvf sphinx-2.0.6-release.tar.gz
It says there's no such file or directory. I know the file is there because I put it there myself, so I'm assuming now that I've misunderstood what is going on here.
Can someone get me past this step so that I can get lost on the next one?
It says there's no such file or directory. I know the file is there because I put it there myself,
Probably not in the right folder - need to 'cd' into the folder containing the file.
But as you dont seem that familer with linux, would suggest using the RPM file instead - so dont have to compile from source.
get the RPM from
http://sphinxsearch.com/downloads/release/
and then upload that. Then use "yum localinstall nameofrpmfile.rpm"
Check the output of uname -a to find if you have 64bit or 32bit system. If mentions x86_64 you have 64bit, and so want the x86_64 RPM file.

How can I find shp2pgsql?

I'm working on a Debian machine with postgresql installed. I need to find shp2pgsql (a utility that converts shapefiles into SQL, as the name suggests).
I've seem suggestions that it's located in the bin directory of postgresql, however I don't know where to find this. I can't locate shp2pgsql through a simple find (probably much too simple, since my Unix skills are not that good):
$ find ~ -name 'shp2pgsql' -print
$
Any suggestions?
Thanks - apologies for the basic question!
I'm pretty sure you need PostGIS installed - its part of that package. You can install it from that site, or its likely that Debian's package manager even has it. Where it ends up depends on package builder.
Actually finding it, if its not in your PATH after you install PostGIS, is probably easiest done through locate shp2pgsql although you may need to updatedb first.
Additionally, you can find your Postgres relevant directories by running pg_config .
The first argument to find is the path from which to search. ~ is your home directory. Your command searches shp2pgsql from your home directory, not in the bin directory. With find, user command find /usr/lib/postgresql/ -name shp2pgsql.
If your system has locate installed, you could also locate shp2pgsql.

Why does installing DBD::Pg fail in DynaLoader?

Error: Can't load '/home/oracle/.cpan/build/DBD-Pg-2.16.1/blib/arch/auto/DBD/Pg/Pg.so' for module DBD::Pg: libpq.so.5: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
Did anyone have similar error while instaling DBD::Pg perl module ? what can I do to fix it ?
You should go under perl to solve these dynamic linking problems. Use strace program &> out, and then grep for libpq.so.5. My guess is your libpq.so.5 is in the wrong location, or your DynaLoader is misconfigured. Read the docs on #dl_library_path.
You can see what your search path is with this (the strace will also show it trying to find the .so by checking each directory):
perl -MDynaLoader -le'print for #DynaLoader::dl_library_path;'
Make sure your libpq.5.so falls in one of those. The strace will also show if the kernel is returning an error to DynaLoader that it is cloaking; moreover, it will certainly tell you everything DynaLoader knows.
The libpq.so.5 file is missing, which indicates that you do not have the Postgresql client library installed. On Ubuntu this file is provided by the libpq5 package.
Make sure the path to the PostgreSQL library is in either ld.so.conf or in a file in ld.so.conf.d and re-run "sudo ldconf" (or sudo /sbin/ldconf). That's taken care of this issue when I've encountered it in the past.
I know lots of people have answered your question but I thought I'd add one more thing. Makefile.PL locates the postgres libraries by executing pg_config. If this can't be found on your path, then you will find this sort of error. Interestingly though, it looks for the headers in the same way. Try running pg_config from your terminal and see what the output is. If it's not found in your path, locate it, add to your path and try to build DBD::Pg again