Re: [GENERAL] How to delete completely duplicate rows

2014-01-02 Thread Janek Sendrowski
Thanks! It's working   Janek -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] How to delete completely duplicate rows

2014-01-01 Thread Janek Sendrowski
Hi,   I want to delete duplicates in my table. I've dropped the unique constraint to insert my data. My id value is a hash calculated witch the values of the two other columns. So I want to delete all columns, which are indentical, but keeping one.   DELETE FROM table t1 USING table t2 WHERE

[GENERAL] cast hex to int in plpgsql

2013-12-31 Thread Janek Sendrowski
Hi, How can I realize the line? v_res := cast(x'v_tmp' as bigint); v_tmp is a text variable with hex digits. this works: v_res := cast(x'6de14a8b478ac' as bigint); I think its about quoting Janek -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] cast hex to int in plpgsql

2013-12-31 Thread Janek Sendrowski
Thanks! That's what I'm searching for.   Janek   -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] bulk insert unique contraint

2013-12-30 Thread Janek Sendrowski
Hi,   I want to insert data in my table and I want to insert the rows, which don't violates the unique contraint of my id. I'm using a 64bit hash for my it. If I do one insert statement, which inserts many rows it doesn't do anything if one row violates the unique contraint. Is there a faster

Re: [GENERAL] bulk insert unique contraint

2013-12-30 Thread Janek Sendrowski
Hi Salah Jubeh,   My files don't have this format. Could it make sense to create such a file with php and import the data from it? Or ist also possible the get certain rows from the file with regexp?   Janek -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes

Re: [GENERAL] bulk insert unique contraint

2013-12-30 Thread Janek Sendrowski
Hi Salah Jubeh,   I'm not in hurry ;) Thanks for your answer. Thats what I've been searching for.   Janek Sendrwoski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Similarity search for sentences

2013-12-06 Thread Janek Sendrowski
('largest  length  m  reach')  AND vector @@ to_tsquery('3.3  306  bodi  cat  kg'); And thats very slow   I didn't know that the pg_trgm Module provides KNN search.   Janek Sendrowski       -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription

Re: [GENERAL] [PERFORM] Similarity search with the tsearch2 extension

2013-12-06 Thread Janek Sendrowski
Sorry, I used AND-statements instead of OR-statement in the example. I notices that gin is much faster than gist, but I don't know why. The query gets slow, because there are many non-stop words which appear very often in my sentences, like in 3% of all the sentences. Do you think it could be

[GENERAL] Similarity search for sentences

2013-12-05 Thread Janek Sendrowski
), but it's all to slow or not suitable. Soundex and Metaphone aren't suitable, as well.   I'm already working on this project since a long time, but without any success. Do any of you have an idea?   I would be very thankful for help.   Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql

[GENERAL] Searching for suiting index

2013-12-01 Thread Janek Sendrowski
of hashvalue for each row to filter the rows dirty at first.   Thank you for your help Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Documentation of C functions

2013-11-27 Thread Janek Sendrowski
Hi, Is there a documentation of postgresql's C functions like SET_VARSIZE for exmaple?   Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Debugging of C functions

2013-11-25 Thread Janek Sendrowski
Hi,   How is it possible to debug user defined functions written in C. I can't just include all the files and run it.   Does anyone have an idea?   Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

[GENERAL] /usr/bin/ld: cannot find [...] when compiling

2013-11-24 Thread Janek Sendrowski
t /usr/bin/ld: cannot find -lxml2 /usr/bin/ld: cannot find -lpam /usr/bin/ld: cannot find -ledit collect2: ld returned 1 exit status make: *** [test] Error 1 Does anyone have an idea? Janek Sendrowski

Re: [GENERAL] /usr/bin/ld: cannot find [...] when compiling

2013-11-24 Thread Janek Sendrowski
directories... Sorry, if this question is to silly, but what do I wrong? Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] /usr/bin/ld: cannot find [...] when compiling

2013-11-24 Thread Janek Sendrowski
the postgresql-server-dev-9.3 package? Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] /usr/bin/ld: cannot find [...] when compiling

2013-11-24 Thread Janek Sendrowski
filename, I have the issue with the includes. Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] include all the postgres libraries (C)

2013-11-22 Thread Janek Sendrowski
for first.   Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] include all the postgres libraries (C)

2013-11-22 Thread Janek Sendrowski
t find -lxslt /usr/bin/ld: cannot find -lxml2 /usr/bin/ld: cannot find -lpam /usr/bin/ld: cannot find -ledit collect2: ld returned 1 exit status make: *** [test] Error 1 Does anyone have an idea? Janek Sendrowski

Re: [GENERAL] Regex files are missing

2013-11-19 Thread Janek Sendrowski
Thanks for your help! I updated to version 9.3 and now it's working. Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Regex files are missing

2013-11-18 Thread Janek Sendrowski
who can help me   Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Regex files are missing

2013-11-18 Thread Janek Sendrowski
Hi, My current version is 9.2. I could just update it. I got the pg_trgm from here: http://git.postgresql.org/gitweb/?p=postgresql.git;a=tree;f=contrib/pg_trgm;hb=refs/heads/master And the regex files from here:

Re: [GENERAL] pg_trgm module: no convertion into Trigrams on one side when comparing

2013-11-15 Thread Janek Sendrowski
Hi Amit, Do you think it would by difficult to edit the source and wirte a new function, wich does it?   Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Install pg_trgm from source

2013-11-15 Thread Janek Sendrowski
Hi, I like to change the source code of the pg_trgm extension a little bit. Where can I get the source code and how do I compile it? I can only find the SQL-files of pg_trgm in my directories. Janek Sendowksi

Re: [GENERAL] Install pg_trgm from source

2013-11-15 Thread Janek Sendrowski
Thanks a lot for your Answers.   That's what I was looking for. I couln't find it. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] pg_trgm module: no convertion into Trigrams on one side when comparing

2013-11-14 Thread Janek Sendrowski
a ranking... something like SELECT similarity('How are your', { ho,how,are,re , hi,wha,hat,at , a}::trgm);   I hope you have an idea   Janek Sendrowski               -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org

[GENERAL] pg_trgm module: no convertion into Trigrams on one side when comparing

2013-11-13 Thread Janek Sendrowski
to change the source code? Thanks for your help Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Suitable Index for my Table

2013-11-04 Thread Janek Sendrowski
+ radius) ... Now I'm searching for a suitable index. Does any of you have an idea? TX very much for any support! Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Suitable Index for my Table

2013-11-04 Thread Janek Sendrowski
Thanks for your Answers!   @Martijn van Oosterhout   I am always searching for single colums. The  values are different every time, because these are distances from my new sentence to my pivots. Does the Index support a query with this WHERE statement: WHERE value BETWEEN (distance1 - radius)

[GENERAL] Searching for appropriate pivots for my Fixed Query Array

2013-11-01 Thread Janek Sendrowski
Hi, I am trying to build my database with a metric index. I am using a Fixed Query Array. I have got a table with many sentences of natural languages. I'm using the Dice Coefficient for calculating the metric space. I am going to take a certain number of sentences and use them as pivots by

Re: [GENERAL] PSQL: argument exceeds the maximum length of 1024 bytes

2013-10-12 Thread Janek Sendrowski
bytes?!   Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Levenshtein Distance with more than 255 characters

2013-09-06 Thread Janek Sendrowski
Do you know the destination. I cant find it.

[GENERAL] Levenshtein Distance with more than 255 characters

2013-09-05 Thread Janek Sendrowski
Hi, Im searching for an optimized Levenshtein Distance like Postgresqls. My problem is that I want to compare strings with a length over 255 characters. Does anyone know a solution? Janek Sendrowski

Re: [GENERAL] store multiple rows with the SELECT INTO statement

2013-09-03 Thread Janek Sendrowski
into the temp table? Janek Sendrowski

Re: [GENERAL] store multiple rows with the SELECT INTO statement

2013-09-03 Thread Janek Sendrowski
The links dont work. I dont know why. how just dont know how to insert the data of a record in a table

[GENERAL] store multiple rows with the SELECT INTO statement

2013-09-01 Thread Janek Sendrowski
Hi, Why is it only possible to store one row by a query which returns multiple rows using the SELECT INTO statement. and How can I do a Query on a record varialbe,somehow like this: SELECT * FROM v_rec Janek Sendrowski

Re: [GENERAL] how to use aggregate functions in this case

2013-08-26 Thread Janek Sendrowski
. Janek Sendrowski

[GENERAL] how to use aggregate functions in this case

2013-08-25 Thread Janek Sendrowski
count smith 0 to 25 5 smith 25 to 507 smith 50 to 752 jones 0 to 25 11 jones 25 to 501 jones 50 to 753 Hope someone who can help me Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] how to use aggregate functions in this case

2013-08-25 Thread Janek Sendrowski
Sorry, I formulated it wrong. My problem is, that I want to count the ranges for every user, but if I usecount(range), it counts the ranges of all users. Janek Sendrowski

[GENERAL] performant import of an array

2013-08-23 Thread Janek Sendrowski
Hi, I have an array and I want to import the data rowwise. Would it make sense to use a function which calls a prepared statement in a loop to import the data performant? Or can I somehow use the COPY FROM command?   Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general

[GENERAL] Query on a record variable

2013-08-18 Thread Janek Sendrowski
me. Janek Sendrowski -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] devide and summarize sql result (all)

2013-08-16 Thread Janek Sendrowski
Von:bricklen brick...@gmail.com An:Janek Sendrowski jane...@web.de Cc:pgsql-general@postgresql.org pgsql-general@postgresql.org Betreff:Re: [GENERAL] devide and summarize sql result (all) On Thu, Aug 15, 2013 at 1:51 PM, Janek Sendrowski jane...@web.de wrote: Hi, My sql query results sth. like

[GENERAL] devide and summarize sql result

2013-08-15 Thread Janek Sendrowski
Hi,   My sql query results sth. like this:   user percentage franz 78% smith 98% franz 81% jason -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] devide and summarize sql result (all)

2013-08-15 Thread Janek Sendrowski
Hi, My sql query results sth. like this: user percentage franz 78% smith 98% franz 81% jason 79% smith 89% smith 85% smith 99% Now Id like to summarize the percentages oder every user like this. smith 2 matches 95-100% 2 matches 85-95% 0 mathes 75-85% franz 0 mathes 95-100% ...

Re: [GENERAL] Fastest Index/Algorithm to find similar sentences

2013-07-27 Thread Janek Sendrowski
Hi Sergey Konoplev,   If I'm searching for a sentence like The tiger is the largest cat species for example.   I can only find the sentences, which include the words tiger, largest, cat, species, but I also like to have the sentences with only three or even two of these words.   Janek --

Re: [GENERAL] Fastest Index/Algorithm to find similar sentences

2013-07-26 Thread Janek Sendrowski
Thanks for your answers. @Amit Langote: I had a look and found out that pg_bigm doesn't support similar matches  @Dann Corbit: The idea with the sequences makes sence. I had a look and I'm not sure, if they support similar sequences Janek -- Sent via pgsql-general mailing list

[GENERAL] Fastest Index/Algorithm to find similar sentences

2013-07-25 Thread Janek Sendrowski
Hi, I'm searching for an algorithm/Index to find similar sentences in a database. The Fulltextsearch is not really suitable because it doesn't have a tolerance. The Levenshtein-distance ist to slow. I also tried pg_trgm module, which works with tri-grams, but it's also very slow with 100.000+

[GENERAL] Index for Levenshtein distance (better format)

2013-07-21 Thread Janek Sendrowski
Hi, Im searching for a suitable Index for my query witch compares Strings with the Levenshtein distance. I read that a prefix index would fit, but I dont know how to build it. I only know that its supported by Gist. I couldn't find an instructions so I hope someone can help me.   Best

[GENERAL] Index for Levenshtein distance

2013-07-20 Thread Janek Sendrowski
Hi, Im searching for a suitable Index for my query witch compares Strings with the Levenshtein distance. I read that a prefix index would fit, but I dont know how to build it. I only know that its supported by Gist. I couldnt find aninstructions so I hope someone can help me. Best regards,