pg-spgist_hamming icon indicating copy to clipboard operation
pg-spgist_hamming copied to clipboard

What is this error?

Open kathynguyen333 opened this issue 4 years ago • 9 comments

root@devil:/var/www/html/pg-spgist_hamming-master/bktree# sudo make installcheck/usr/lib/postgresql/11/lib/pgxs/src/makefiles/../../src/test/regress/pg_regress --inputdir=./ --bindir='/usr/lib/postgresql/11/bin'    --dbname=contrib_regression init utilities test_1 test_2 int8
(using postmaster on Unix socket, default port)
============== dropping database "contrib_regression" ==============
NOTICE:  database "contrib_regression" does not exist, skipping
DROP DATABASE
============== creating database "contrib_regression" ==============
ERROR:  permission denied to create database
command failed: "/usr/lib/postgresql/11/bin/psql" -X -c "CREATE DATABASE \"contrib_regression\" TEMPLATE=template0" "postgres"
/usr/lib/postgresql/11/lib/pgxs/src/makefiles/pgxs.mk:403: recipe for target 'installcheck' failed
make: *** [installcheck] Error 2

kathynguyen333 avatar May 02 '20 18:05 kathynguyen333

Installcheck is failing because the user you're authenticating to on postgresql can't create databases. You have a permissions issue.

Also, I think your error text has a few missing newlines?

Technically, you don't need to run sudo make installcheck, it only checks you installed everything correctly.

fake-name avatar May 02 '20 18:05 fake-name

Tks! i try

root@devil:/var/www/html/pg-spgist_hamming-master/bktree# sudo make install
/bin/mkdir -p '/usr/lib/postgresql/11/lib'
/bin/mkdir -p '/usr/share/postgresql/11/extension'
/bin/mkdir -p '/usr/share/postgresql/11/extension'
/usr/bin/install -c -m 755  bktree.so '/usr/lib/postgresql/11/lib/bktree.so'
/usr/bin/install -c -m 644 .//bktree.control '/usr/share/postgresql/11/extension/'
/usr/bin/install -c -m 644 .//bktree--1.0.sql  '/usr/share/postgresql/11/extension/'
/bin/mkdir -p '/usr/lib/postgresql/11/lib/bitcode/bktree'
/bin/mkdir -p '/usr/lib/postgresql/11/lib/bitcode'/bktree/
/usr/bin/install -c -m 644 bktree.bc '/usr/lib/postgresql/11/lib/bitcode'/bktree/./
/usr/bin/install -c -m 644 bktree_utils.bc '/usr/lib/postgresql/11/lib/bitcode'/bktree/./
cd '/usr/lib/postgresql/11/lib/bitcode' && /usr/lib/llvm-6.0/bin/llvm-lto -thinlto -thinlto-action=thinlink -o bktree.index.bc bktree/bktree.bc bktree/bktree_utils.bc

These are not errors, right ?

kathynguyen333 avatar May 02 '20 18:05 kathynguyen333

That just looks like the normal install process.

Also, please use proper formatting for code blocks.

fake-name avatar May 02 '20 18:05 fake-name

Sorry, this is my first commit on github . thank you very much . But I have a question . Does this program need a strong system? My VPS only 2core and 4gb

kathynguyen333 avatar May 02 '20 18:05 kathynguyen333

It's not a program? It's a postgres extension, and it entirely depends on the number if hashes you're trying to index, and your tolerance for query time..

fake-name avatar May 02 '20 18:05 fake-name

Hey @fake-name , I am facing the same issue as @kathynguyen333 . but after all the steps when start the postgres and create the extension, it is saying Operator<--> already exists. and when I try to drop the extension, it says extension does not exist. postgres=# DROP EXTENSION bktree; ERROR: extension "bktree" does not exist postgres=# CREATE EXTENSION bktree; ERROR: operator <-> already exists

aigupta avatar Aug 12 '21 11:08 aigupta

@aigupta - You're running into a completely different issue.

From the look of it, something is already providing the <-> operator. I know the pg_trgm extension also uses that, so if you have it enabled, it will break spgist_hamming.

fake-name avatar Aug 14 '21 08:08 fake-name

@fake-name

I know the pg_trgm extension also uses that, so if you have it enabled, it will break spgist_hamming.

This might be a problem in the future for me. Is it relatively simple to redefine the symbol your extension uses for the operator and recompile?

Zer0- avatar Aug 31 '21 20:08 Zer0-

This might be a problem in the future for me. Is it relatively simple to redefine the symbol your extension uses for the operator and recompile?

I believe you just have to change https://github.com/fake-name/pg-spgist_hamming/blob/master/bktree/bktree--1.0.sql#L81 before installing the extension.

The overload of <-> is basically so you can verify the in-db hamming distance calculation matches the out-of-db one (and so I could test it). It's not actually used in the normal course of the index.

fake-name avatar Sep 01 '21 03:09 fake-name