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

2013-09-06 Thread Szymon Guz
On 6 September 2013 01:00, Janek Sendrowski jane...@web.de wrote: Hi, I'm searching for an optimized Levenshtein Distance like Postgresql's. My problem is that I want to compare strings with a length over 255 characters. Does anyone know a solution? Janek Sendrowski Hi, I'm not sure

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

2013-09-06 Thread Tom Lane
Szymon Guz mabew...@gmail.com writes: On 6 September 2013 01:00, Janek Sendrowski jane...@web.de wrote: I'm searching for an optimized Levenshtein Distance like Postgresql's. My problem is that I want to compare strings with a length over 255 characters. Does anyone know a solution? I'm not

Re: [GENERAL] How to check if any WAL file is missing in archive folder

2013-09-06 Thread Albe Laurenz
ascot.m...@gmail.com wrote: I am planing to backup archived WAL files from master to another machine, is there a way to check and make sure the backup archive file are all good and no any file missing or corrupted? The only 100% safe way would be to restore them, e.g. with a standby

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

2013-09-06 Thread Szymon Guz
On 6 September 2013 08:47, Tom Lane t...@sss.pgh.pa.us wrote: Szymon Guz mabew...@gmail.com writes: On 6 September 2013 01:00, Janek Sendrowski jane...@web.de wrote: I'm searching for an optimized Levenshtein Distance like Postgresql's. My problem is that I want to compare strings with a

Re: [GENERAL] Is this a bug in ECPG?

2013-09-06 Thread Boszormenyi Zoltan
2013-09-06 02:57 keltezéssel, Wang, Jing írta: Hi, ECPG don't support the following scenario: char cur_name = cur1; EXEC SQL DECLARE :cur_name CURSOR FOR ... EXEC SQL OPEN :cur_name; EXEC SQL FETCH cur1 INTO... ... EXEC SQL CLOSE :cur_name; An compile error will occur for above codes

[GENERAL] Failed to autoconvert '1' to text.

2013-09-06 Thread Szymon Guz
Hi, why isn't 'aa' always treated as string? While testing function for levenshtein distance I've noticed that: with x as ( select '1' a, '2' b ) SELECT levenshtein(a, b), length(a) FROM x; ERROR: failed to find conversion function from unknown to text with x as ( select '1'::TEXT

Re: [GENERAL] Failed to autoconvert '1' to text.

2013-09-06 Thread Richard Huxton
On 06/09/13 09:13, Szymon Guz wrote: Hi, why isn't 'aa' always treated as string? with x as ( select '1' a, '2' b ) SELECT levenshtein(a, b), length(a) FROM x; ERROR: failed to find conversion function from unknown to text Why should I cast '1' to '1'::TEXT to satisfy a function

Re: [GENERAL] Failed to autoconvert '1' to text.

2013-09-06 Thread Szymon Guz
On 6 September 2013 10:33, Richard Huxton d...@archonet.com wrote: On 06/09/13 09:13, Szymon Guz wrote: Hi, why isn't 'aa' always treated as string? with x as ( select '1' a, '2' b ) SELECT levenshtein(a, b), length(a) FROM x; ERROR: failed to find conversion function

Re: [GENERAL] My Experiment of PG crash when dealing with huge amount of data

2013-09-06 Thread 高健
Hello: Sorry for disturbing again. Some of my friends told me about cgroups, So I tried it first. I found that cgroups can work for task such as wget. But it can't work for my postgres process. [root@cent6 Desktop]# cat /etc/cgconfig.conf # # Copyright IBM Corporation. 2007 # # Authors:

Re: [GENERAL] pg_dump question (exclude schemas)

2013-09-06 Thread vinayak
I want to backup a database but exclude certain schemas with a patter. I have 100 schemas with the pattern: 'sch_000', 'sch_001', and so on. Will this work? $pg_dump other_options --exclude-schema='sch_*' this does not seem to exclude all schemas with this pattern ( 'sch_*' ), anything wrong

[GENERAL] psql client memory usage

2013-09-06 Thread Tim Kane
Hi all, I have a fairly simple query, running on a particularly large table. For illustration: echo select * from really_big_table; | psql my_database /dev/null When I monitor the memory usage of the psql session, it continually grows. In fact, for this particularly large table ­ it grows to

Re: [GENERAL] psql client memory usage

2013-09-06 Thread Daniel Verite
Tim Kane wrote: I have a fairly simple query, running on a particularly large table. For illustration: echo select * from really_big_table; | psql my_database /dev/null See psql's FETCH_COUNT. From the manpage: FETCH_COUNT If this variable is set to an

Re: [GENERAL] Old record migration to another table made the db slower

2013-09-06 Thread Michael Paquier
On Thu, Sep 5, 2013 at 6:05 PM, Tomas Vondra t...@fuzzy.cz wrote: On 5 Září 2013, 8:52, Arun P.L wrote: Actual intention of the migration of old records was to speed up the original_data_table which is used frequently by users. How can I get this problem get this fixed? What are the steps to

Re: [GENERAL] psql client memory usage

2013-09-06 Thread Suzuki Hironobu
(13/09/06 21:06), Tim Kane wrote: Hi all, I have a fairly simple query, running on a particularly large table. For illustration: echo select * from really_big_table; | psql my_database /dev/null When I monitor the memory usage of the psql session, it continually grows. In fact, for this

Re: [GENERAL] How to check if any WAL file is missing in archive folder

2013-09-06 Thread Michael Paquier
On Fri, Sep 6, 2013 at 4:04 PM, Albe Laurenz laurenz.a...@wien.gv.at wrote: ascot.m...@gmail.com wrote: I am planing to backup archived WAL files from master to another machine, is there a way to check and make sure the backup archive file are all good and no any file missing or corrupted?

Re: [GENERAL] psql client memory usage

2013-09-06 Thread Tim Kane
Ahh. All these years (albeit sporadic), I never knew about FETCH_COUNT. That makes sense. Thanks muchly. On 06/09/2013 14:11, Suzuki Hironobu hiron...@interdb.jp wrote: (13/09/06 21:06), Tim Kane wrote: Hi all, I have a fairly simple query, running on a particularly large table. For

[GENERAL] PK referenced function

2013-09-06 Thread Agustin Larreinegabe
Hi everyone: I want to know if exists a postgres function or some easy way to know if a PK in a table is already referenced in another table/tables. e.g. I want to delete a row but first I've got to change or delete in the table/tables where is referenced, and I have many table where could be

Re: [GENERAL] PK referenced function

2013-09-06 Thread Serge Fonville
Hi Augustin, PostgreSQL has a couple of possibilities in this regard. For example, http://stackoverflow.com/questions/1152260/postgres-sql-to-list-table-foreign-keyshas a couple of very clear queries. Additionally, it would be very useful if you could further clarify the problem you are trying

Re: [GENERAL] PK referenced function

2013-09-06 Thread Michael Paquier
On Fri, Sep 6, 2013 at 10:26 PM, Agustin Larreinegabe alarre...@gmail.com wrote: I want to know if exists a postgres function or some easy way to know if a PK in a table is already referenced in another table/tables. psql has all you want for that. For example in this case: =# create table aa (a

Re: [GENERAL] psql client memory usage

2013-09-06 Thread Merlin Moncure
On Fri, Sep 6, 2013 at 8:19 AM, Tim Kane tim.k...@gmail.com wrote: Ahh. All these years (albeit sporadic), I never knew about FETCH_COUNT. That makes sense. Thanks muchly. Not your fault: FETCH_COUNT is a hack IMO. The real issue was that libpq (until recently) forced the entire result into

Re: [GENERAL] PK referenced function

2013-09-06 Thread Agustin Larreinegabe
Thanks a lot On Fri, Sep 6, 2013 at 9:51 AM, Michael Paquier michael.paqu...@gmail.comwrote: On Fri, Sep 6, 2013 at 10:26 PM, Agustin Larreinegabe alarre...@gmail.com wrote: I want to know if exists a postgres function or some easy way to know if a PK in a table is already referenced in

Re: [GENERAL] SQL Path in psql

2013-09-06 Thread miles
Bobby Dewitt wrote I come from an Oracle background and I am fairly new to Postgres. Oracle's command line utility (SQL*Plus) uses an environment variable called SQLPATH to search the given directories for SQL scripts that the user calls to execute using a method similar to the \i

[GENERAL] are WAL file segment boundaries a point of consistency?

2013-09-06 Thread John Lumby
We use logshipping replication,    and have recently noticed a nasty bug  where, in certain very rare cases, the primary archive_command program will fail to send the WAL file to the standby but report good return code 0 to postgresql. In such cases,  if the standby then  triggers its termination

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

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

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

2013-09-06 Thread janek12
Where can I change levensthein_max_length? Janek Sendrowski Von: Szymon Guz mabew...@gmail.com An: Tom Lane t...@sss.pgh.pa.us Betreff: Re: [GENERAL] Levenshtein Distance with more than 255 characters On 6 September 2013 08:47, Tom Lane t...@sss.pgh.pa.us wrote: Szymon Guz mabew...@gmail.com

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

2013-09-06 Thread John R Pierce
On 9/6/2013 2:00 PM, jane...@web.de wrote: Where can I change levensthein_max_length? as the message you quoted said, its #define MAX_LEVENSHTEIN_STRLEN I'd expect this (without bothering to look) to be in a .h file in the fuzzystrmatch contributed module directory. -- john r

Re: [GENERAL] SQL Path in psql

2013-09-06 Thread Miles Pomeroy
In my opinion, the use of such a feature is to make simple, commonly used scripts available from wherever you start up psql and no matter what database you are connecting to. On Oracle/SQL*Plus I have used this feature to create simple scripts that replicate informational backslash commands in

Re: [GENERAL] SQL Path in psql

2013-09-06 Thread David Kerr
On Fri, Sep 06, 2013 at 10:45:26AM -0700, David Johnston wrote: - lup wrote - - - I wonder if this would at least get the full path on-screen for a c/p - \! for d in $SQLPATH; do find $d -name - script-filename - ; done - - That said, I would down-vote this suggestion. I tend to

[GENERAL] select DISTINCT

2013-09-06 Thread pg noob
Hi all, I'm curious about some of the query estimates that I'm seeing with queries that use DISTINCT. I am using postgres 8.4.13 I did a couple of quick tests, and found that PostgreSQL seems to do some expensive work to return DISTINCT rows. This is contrary to what I was expecting because I

Re: [GENERAL] SQL Path in psql

2013-09-06 Thread David Johnston
lup wrote I wonder if this would at least get the full path on-screen for a c/p \! for d in $SQLPATH; do find $d -name script-filename ; done That said, I would down-vote this suggestion. I tend to put sql files in amongst my various project dirs and maintaining the envvar isn't

Re: [GENERAL] SQL Path in psql

2013-09-06 Thread Rob Sargentg
On 09/06/2013 11:05 AM, miles wrote: Bobby Dewitt wrote I come from an Oracle background and I am fairly new to Postgres. Oracle's command line utility (SQL*Plus) uses an environment variable called SQLPATH to search the given directories for SQL scripts that the user calls to execute using a

Re: [GENERAL] Call for design: PostgreSQL mugs

2013-09-06 Thread Berend Tober
Peter Geoghegan wrote: On Thu, Sep 5, 2013 at 8:22 AM, Merlin Moncure mmonc...@gmail.com wrote: I'm still partial to this guy: http://www.commandprompt.com/images/mammoth_versus_dolphin_500.jpg I dislike that image, and always have. ... I agree with Mr. Geoghegan. That image should be

Re: [GENERAL] select DISTINCT

2013-09-06 Thread Kevin Grittner
pg noob pgn...@gmail.com wrote: The GROUP BY performs much better than DISTINCT even though both these two queries return the exact same count result. No, GROUP BY performs much better than count(DISTINCT colname). To confirm that this isn't something that has changed in the four years since

Re: [GENERAL] Call for design: PostgreSQL mugs

2013-09-06 Thread Peter Geoghegan
On Thu, Sep 5, 2013 at 8:22 AM, Merlin Moncure mmonc...@gmail.com wrote: I'm still partial to this guy: http://www.commandprompt.com/images/mammoth_versus_dolphin_500.jpg I dislike that image, and always have. Apart from risking alienating people, I think it sends the wrong message - that we

Re: [GENERAL] select DISTINCT

2013-09-06 Thread Jeff Janes
On Friday, September 6, 2013, pg noob wrote: Hi all, I'm curious about some of the query estimates that I'm seeing with queries that use DISTINCT. I am using postgres 8.4.13 I did a couple of quick tests, and found that PostgreSQL seems to do some expensive work to return DISTINCT rows.

[GENERAL] Constraint exclusion and overlapping range checks

2013-09-06 Thread Steve Atkins
If I have a partitioned table that has some range constraints that look kinda like they're intended for constraint exclusion, but aren't quite non-overlapping, will that break anything? e.g. create table jan ( …, check(created = '2013-01-01' and created '2013-02-01'), check(id =0 and id

Re: [GENERAL] Constraint exclusion and overlapping range checks

2013-09-06 Thread François Beausoleil
Le 2013-09-07 à 00:29, Steve Atkins a écrit : If I have a partitioned table that has some range constraints that look kinda like they're intended for constraint exclusion, but aren't quite non-overlapping, will that break anything? e.g. create table jan ( …, check(created =

Re: [GENERAL] Constraint exclusion and overlapping range checks

2013-09-06 Thread Steve Atkins
On Sep 6, 2013, at 9:37 PM, François Beausoleil franc...@teksol.info wrote: Le 2013-09-07 à 00:29, Steve Atkins a écrit : If I have a partitioned table that has some range constraints that look kinda like they're intended for constraint exclusion, but aren't quite non-overlapping, will