[GENERAL] C++, Postgres , libpqxx huge query

2014-05-04 Thread alexandros_e
Hello experts. I have posted this question on stack overflow, but I did not get any detailed answer, so I thought I should cross post here. My apologies. I have to execute an SQL query to Postgres by the following code. The query returns a huge number of rows (40M or more) and has 4 integer

Re: [GENERAL] C++, Postgres , libpqxx huge query

2014-05-04 Thread alexandros_e
To answer my own question, I adapted How to use pqxx::stateless_cursor class from libpqxx? try { work W(*Conn); pqxx::stateless_cursorpqxx::cursor_base::read_only, pqxx::cursor_base::owned cursor(W, sql[sqlLoad], mycursor, false); /* Assume you know total

Re: [GENERAL] High Level Committers Wanted

2014-03-12 Thread alexandros_e
It seems like spam to me. Where is the guy's name or credentials? If I would request something, I would sign with my name, government email and telephone. -- View this message in context: http://postgresql.1045698.n5.nabble.com/High-Level-Committers-Wanted-tp5795695p5795703.html Sent from the

[GENERAL] pg_trgm extension and theory

2014-02-22 Thread alexandros_e
Hello to all experts, I am considering of using pg_trgm extension in a research publication, since initial results seem promising. The index seems to works pretty fast for finding similar text and significantly accelerate query time. The problem is that I do not know the theory behind it or the

[GENERAL] Pg_trgm and invalid invalid byte sequence for encoding UTF8

2014-02-12 Thread alexandros_e
Hello experts, I want to compare integer arrays basically with methods based on string similarity (i.e., levenshtein, trigrams etc).. In order to do that I hacked a custom function that converts those integer array to strings, where each integer is converted to a character by the function

Re: [GENERAL] client that supports editing views

2014-02-08 Thread alexandros_e
Why not use Access directly? You can connect to PostgreSQL though ODBC (inside Access) and do the forms there. I am sure 95% that I had done that in the past, although I cannot be sure it works with the most recent versions. Something like that:

Re: [GENERAL] Dynamic insert into ARRAY? plpgsql

2014-02-08 Thread alexandros_e
You must a) join the 2 tables on the orderID ... where orderID=15 and then GROUP BY the result by the order ID and concat the orderlines by a custom aggregate function like: http://www.postgresql.org/message-id/db7789b.0309131210.625da...@posting.google.com -- View this message in context:

Re: [GENERAL] Temporary table already exists

2014-02-06 Thread alexandros_e
@mephysto I think you are trying to solve the wrong type of problem. Creation of tables (temporary or not) are not supposed to run concurrently. So, this is not an issue of PostgreSQL but design. There are two ways to solve the problem. a) You could use the sessionID (provided The Glassfish

Re: [GENERAL] Hard upgrade (everything)

2014-02-06 Thread alexandros_e
I would use normal pg_dump and pg_restore for the DBs and not utils/postgis_restore.pl. Also, AFTER I backup all databases and everything else, you could try to upgrade Postgis without upgrading PostgreSQL by buliding from source e.g.

[GENERAL] Postgresql GROUP BY SIMILAR but not equal values

2014-02-06 Thread alexandros_e
I wanted to ask you the following question to all experts here. Let's say I have this table foo ID|G1|T1| 1|2|ABC| 1|2|ABCD| 1|2|DEF| 1|2|DEFG| SELECT * FROM foo GROUP BY ID,G1,T1 RETURNS exactly the same table. Is there a way in SQL or PostgreSQL in general to group by values than are not

Re: [GENERAL] Postgresql GROUP BY SIMILAR but not equal values

2014-02-06 Thread alexandros_e
Conceptually, Tom (as always) is right. But Alban's hack help. DROP TABLE foo; CREATE TABLE IF NOT EXISTS foo(ID INTEGER,G1 INTEGER, T1 TEXT, ID2 SERIAL PRIMARY KEY); INSERT INTO foo(ID,G1,T1) VALUES(1,2,'ABC'); INSERT INTO foo(ID,G1,T1) VALUES(1,2,'ABCD'); INSERT INTO foo(ID,G1,T1)

[GENERAL] Postgresql multidimensional arrays cast fail

2014-02-01 Thread alexandros_e
I do: SELECT '{{1,2},{3,4}}'::INTEGER[][] But I get: {{1,2},{3,4}} INTEGER[]. Somehow the PostgreSQL server does not understand that is a multidimensional array. So, later if I want to get {1,2} or {3,4}, the field[1] or field[2]. Evem when I try: field [1:1] I get {{1,2}} and not plain one

Re: [GENERAL] Postgresql multidimensional arrays cast fail

2014-02-01 Thread alexandros_e
This is probably the only way to do it. Still, it seems to me an overkill if basically you need to run a function at each multidimensional array to get access to each i-array element. Thanks for your answer. -- View this message in context:

Re: [GENERAL] Reindexing and tablespaces

2014-01-31 Thread alexandros_e
You were right. I just reindexed the DB and I saw no real changes in drive storage (those tablespaces are on separate hard disk volumes). Thanks -- View this message in context: http://postgresql.1045698.n5.nabble.com/Reindexing-and-tablespaces-tp5789827p5789853.html Sent from the PostgreSQL -

[GENERAL] Reindexing and tablespaces

2014-01-30 Thread alexandros_e
Hello to all, I have done ALTER DATABASE [database_name] SET default_tablespace = [new_tablespace]; I am wondering, if I reindex this entire DB would the indexes automatically moved into the [new_tablespace] or will they remain in the tablespace they were originally created on; -- View this

[GENERAL] levenshtein_less_equal does not work

2014-01-24 Thread alexandros_e
Hello to all, I always use PostgreSQL from enterpriseDB. I have both 9.2 and 9.1 latest verions installed on two different Ubuntu 64bit machines. For some reason levenshtein_less_equal does not work, in contrast to levenshtein which works as expected. I even downloaded the src code for PostgreSQL

Re: [GENERAL] levenshtein_less_equal does not work

2014-01-24 Thread alexandros_e
Query: SELECT levenshtein_less_equal('extensive', 'exhaustive',2); ERROR: function levenshtein_less_equal(unknown, unknown, integer) does not exist LINE 1: SELECT levenshtein_less_equal('extensive', 'exhaustive',2); ^ HINT: No function matches the given name and argument types.

Re: [GENERAL] levenshtein_less_equal does not work

2014-01-24 Thread alexandros_e
Just this: create extension fuzzystrmatch; If the extension was not installed, then the simple levenstein distance would not work either. -- View this message in context: http://postgresql.1045698.n5.nabble.com/levenshtein-less-equal-does-not-work-tp5788710p5788715.html Sent from the

Re: [GENERAL] levenshtein_less_equal does not work

2014-01-24 Thread alexandros_e
SELECT version(); and \df levenshtein_less_equal PostgreSQL 9.1.11 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52), 64-bit routing_nw2=# \df levenshtein_less_equal List of functions Schema | Name | Result data type | Argument

Re: [GENERAL] levenshtein_less_equal does not work

2014-01-24 Thread alexandros_e
=# \dx List of installed extensions Name | Version | Schema | Description -+-++-- plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language (1 row) -# \df levenshtein*

Re: [GENERAL] levenshtein_less_equal does not work

2014-01-24 Thread alexandros_e
With your help I found the solution. My DB was initially based on a 9.0 server and I had restored it on the 9.1 server. For some reason 9.0 fuzzystrmatch functions (levenstein...) were already present in this DB. So, CREATE EXTENSION fuzzystrmatch did not work. I had to manually remove function