[GENERAL] best practice for || set of rows --> function --> set of rows

2013-09-17 Thread Rémi Cura
Hello Dear List, this is a re-post with a more clear title and rewrite. I have a design issue : My function works on ordered set of rows and returns ordered set of rows (less thant input). I want to use it in standard sql query (in WITH for example). What is best practice for input? I see 3 solu

Re: [GENERAL] Full text search regression tests

2013-09-17 Thread Beena Emerson
I am sorry this mail was not meant for this list.

[GENERAL] Full text search regression tests

2013-09-17 Thread Beena Emerson
Hello All, Attached patch adds regression tests to check the full-text search capability of pg_bigm. Regards, Beena Emerson bigm-fulltext-search-regression.patch Description: Binary data -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscripti

[GENERAL] need a hand with my backup strategy please...

2013-09-17 Thread Echlin, Jamie (KFIA 611)
Morning I made the mistake of thinking that I could recover to any point in time with a logical backup plus WAL files, unfortunately that is not the case. I was rsync'ing wal files to another system, and set the archive timeout to 5 mins, and the retention to allow for 25 hours worth or so. Unf

Re: [GENERAL] need a hand with my backup strategy please...

2013-09-17 Thread Ray Stell
On Sep 17, 2013, at 7:22 AM, "Echlin, Jamie (KFIA 611)" wrote: > Unfortunately though if there is heavy load, the wal files will be generated > more regularly than the 5 minute max. If you wrote the WAL to an external, mounted disk, wouldn't that solve the issue?

Re: [GENERAL] need a hand with my backup strategy please...

2013-09-17 Thread Echlin, Jamie (KFIA 611)
>> Unfortunately though if there is heavy load, the wal files will be generated >> more regularly than the 5 minute max. > If you wrote the WAL to an external, mounted disk, wouldn't that solve the > issue? What I'm trying to say is that I configured it to keep (60/5) * 24 segments plus a few

[GENERAL] Using ODBC and VBA to pull data from a large object

2013-09-17 Thread Adam C Falkenberg
Good Morning, I had a question about using ODBC with large objects. When I query the pg_largeobject table and return data to an ADO recordset, I can only get the first 255 bytes even though the record contains 2048 bytes of data (all the bytes after the first 255 show as 0). When I checked th

Re: [GENERAL] need a hand with my backup strategy please...

2013-09-17 Thread Albe Laurenz
Jamie Echlin wrote: > What I'm trying to say is that I configured it to keep (60/5) * 24 segments > plus a few spare, because > I am switching xlog every 5 mins. But if there is heavy load then they will > be generated more often > than every 5 mins, so that number won't be enough. You should de

Re: [GENERAL] need a hand with my backup strategy please...

2013-09-17 Thread Echlin, Jamie (KFIA 611)
Thanks for your answer Laurenz. I was planning to rely on the disk backup (of the base backup) if I wanted to restore to a version before the last on disk base backup. But your point about redundancy is good... I think I will keep two base backups, and do a base backup every day. Over the netwo

Re: [GENERAL] best practice for || set of rows --> function --> set of rows

2013-09-17 Thread Merlin Moncure
On Tue, Sep 17, 2013 at 2:06 AM, Rémi Cura wrote: > The only kind of function taking set of record as input I know of is > aggregate function, but it returns only one row and the output of union can > take multiple row. This may or may not help (I suggest posting a more complete example of what y

Re: [GENERAL] need a hand with my backup strategy please...

2013-09-17 Thread Albe Laurenz
Jamie Echlin wrote: > I was planning to rely on the disk backup (of the base backup) if I wanted to > restore to a version > before the last on disk base backup. But your point about redundancy is > good... I think I will keep > two base backups, and do a base backup every day. Over the network t

Re: [GENERAL] Using ODBC and VBA to pull data from a large object

2013-09-17 Thread Bret Stern
On Tue, 2013-09-17 at 08:32 -0400, Adam C Falkenberg wrote: > Good Morning, > > I had a question about using ODBC with large objects. When I query > the pg_largeobject table and return data to an ADO recordset, I can > only get the first 255 bytes even though the record contains 2048 > bytes of

[GENERAL] remove everything before the period

2013-09-17 Thread karinos57
Hi, I am trying to remove everything before the period in other words i only want to show the values that starts from the period. For instance 897.78 ==> 78 74.25 ==> 25 3657.256 ==> 256 well the code below only shows everything before the period but i want to show everything after the period se

Re: [GENERAL] using Replace funcion in postgresql

2013-09-17 Thread karinos57
just as FYI the database i am using is Netezza so my data type is CHARACTER VARYING(6). The error i am getting is 'Buffer Overflow'. So the funny thing is when i change this '' to this ' ' then the query runs but it is putting a blank space between the values like this 88 97 but i get an error wh

[GENERAL] Number of WAL segment

2013-09-17 Thread tdev457
Hi, I am using PostgreSQL 8.3.8!!! How can I increase number of WAL segments in pg_xlog??? Current settings are: checkpoint_segments=10 checkpoint_completion_target=0.5 WAL segments are generated every 10 min and I want to keep WAL segments in pg_xlog for at least 3h. Thanks... -- View this m

[GENERAL] How to compare the results of two queries?

2013-09-17 Thread Juan Daniel Santana Rodés
I am developing a task in which I need to know how to compare the results of two queries ... I thought about creating a procedure which both queries received by parameters respectively. Then somehow able to run queries and return if both have the same result. As a feature of the problem, both qu

Re: [GENERAL] best practice for || set of rows --> function --> set of rows

2013-09-17 Thread David Johnston
remi.cura wrote > What is best practice for input? There is none; you have options because different scenarios require different solutions. > I see 3 solutions : > _give table name as input || so no order unless I use view, doesn't work > with CTE and all. > _give array and use unnest/arrayagg |

Re: [GENERAL] How to compare the results of two queries?

2013-09-17 Thread Igor Neyman
> -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > ow...@postgresql.org] On Behalf Of Juan Daniel Santana Rodés > Sent: Tuesday, September 17, 2013 11:00 AM > To: pgsql-general@postgresql.org > Subject: [GENERAL] How to compare the results of two querie

Re: [GENERAL] How to compare the results of two queries?

2013-09-17 Thread Raymond O'Donnell
On 17/09/2013 15:59, Juan Daniel Santana Rodés wrote: > I am developing a task in which I need to know how to compare the > results of two queries ... > I thought about creating a procedure which both queries received by > parameters respectively. Then somehow able to run queries and return if > bo

Re: [GENERAL] using Replace funcion in postgresql

2013-09-17 Thread Adrian Klaver
On 09/16/2013 06:20 PM, karinos57 wrote: just as FYI the database i am using is Netezza so my data type is CHARACTER VARYING(6). The error i am getting is 'Buffer Overflow'. So the funny thing is when i change this '' to this ' ' then the query runs but it is putting a blank space between the

Re: [GENERAL] How to compare the results of two queries?

2013-09-17 Thread Luca Ferrari
On Tue, Sep 17, 2013 at 4:59 PM, Juan Daniel Santana Rodés wrote: > For example the execution of the function would be something like ... > > select compare('select * from table1', 'select * from table2'); > > For this case the result is false, then the queries are executed on > different tables.

Re: [GENERAL] How to compare the results of two queries?

2013-09-17 Thread Igor Neyman
> -Original Message- > From: Juan Daniel Santana Rodés [mailto:jdsant...@estudiantes.uci.cu] > Sent: Tuesday, September 17, 2013 11:54 AM > To: Igor Neyman > Subject: Re: [GENERAL] How to compare the results of two queries? > > El 17/09/13 11:27, Igor Neyman escribió: > > create or repla

Re: [GENERAL] Using ODBC and VBA to pull data from a large object

2013-09-17 Thread Adam C Falkenberg
Thanks for the response. The example you sent is what I tried to follow when I originally worked on this. It works great for the first 255 bytes, but after that it returns 0's. Is there any way to get all of the data in a large object returned to a recordset (not just the first 255 bytes)? T

Re: [GENERAL] remove everything before the period

2013-09-17 Thread Giuseppe Broccolo
Il 17/09/2013 04:21, karinos57 ha scritto: Hi, I am trying to remove everything before the period in other words i only want to show the values that starts from the period. For instance 897.78 ==> 78 74.25 ==> 25 3657.256 ==> 256 well the code below only shows everything before the period but i

[GENERAL] upgrade from 9.2.x to 9.3 causes significant performance degradation

2013-09-17 Thread Lonni J Friedman
Greetings, I'm running a PostgreSQL 9.3.0 cluster (1 master with two streaming replication hot standby slaves) on RHEL6-x86_64. Yesterday I upgraded from 9.2.4 to 9.3.0, and since the upgrade I'm seeing a significant performance degradation. PostgreSQL simply feels slower. Nothing other than the

Re: [GENERAL] Using ODBC and VBA to pull data from a large object

2013-09-17 Thread Adam C Falkenberg
Sorry about that. Here's the driver information and some code. Thanks. Driver Name: PostgreSQL ANSI Version: 9.02.01.00 constr = "Driver={PostgreSQL ANSI}; Server=servername; Port=5432; Database=databasename; Uid=username; Pwd=password;" With conn .ConnectionString = (constr) .Open End

Re: [GENERAL] How to compare the results of two queries?

2013-09-17 Thread Igor Neyman
> -Original Message- > From: Juan Daniel Santana Rodés [mailto:jdsant...@estudiantes.uci.cu] > Sent: Tuesday, September 17, 2013 12:51 PM > To: Igor Neyman > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] How to compare the results of two queries? > > > > I want to know if the

Re: [GENERAL] upgrade from 9.2.x to 9.3 causes significant performance degradation

2013-09-17 Thread Eduardo Morras
On Tue, 17 Sep 2013 09:19:29 -0700 Lonni J Friedman wrote: > Greetings, > I'm running a PostgreSQL 9.3.0 cluster (1 master with two streaming > replication hot standby slaves) on RHEL6-x86_64. Yesterday I upgraded > from 9.2.4 to 9.3.0, and since the upgrade I'm seeing a significant > performanc

Re: [GENERAL] How to compare the results of two queries?

2013-09-17 Thread Eduardo Morras
On Tue, 17 Sep 2013 10:59:43 -0400 Juan Daniel Santana Rodés wrote: > I've been studying and I found that there EXECUTE but to use it, first > you should have used PREPARE, and in this case the values ​​of the > parameters are already made ​​inquiries. > For example the execution of the functio

Re: [GENERAL] How to compare the results of two queries?

2013-09-17 Thread Juan Daniel Santana Rodés
El 17/09/13 12:02, Igor Neyman escribió: -Original Message- From: Juan Daniel Santana Rodés [mailto:jdsant...@estudiantes.uci.cu] Sent: Tuesday, September 17, 2013 11:54 AM To: Igor Neyman Subject: Re: [GENERAL] How to compare the results of two queries? El 17/09/13 11:27, Igor Neyman

Re: [GENERAL] How to compare the results of two queries?

2013-09-17 Thread Igor Neyman
> -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > ow...@postgresql.org] On Behalf Of Igor Neyman > Sent: Tuesday, September 17, 2013 12:02 PM > To: Juan Daniel Santana Rodés; pgsql-general@postgresql.org > Subject: Re: [GENERAL] How to compare the re

Re: [GENERAL] Number of WAL segment

2013-09-17 Thread Suzuki Hironobu
Hi, (13/09/17 21:46), tdev457 wrote: Hi, I am using PostgreSQL 8.3.8!!! How can I increase number of WAL segments in pg_xlog??? Current settings are: checkpoint_segments=10 checkpoint_completion_target=0.5 WAL segments are generated every 10 min and I want to keep WAL segments in pg_xlog for at

[GENERAL] Connect postgres to SQLSERVER

2013-09-17 Thread Agustin Larreinegabe
HI, Is there a way to connect to a sqlserver like dblink? I just need to execute a Procedure in sqlserver when something happen -- Gracias - Agustín Larreinegabe

Re: [GENERAL] How to compare the results of two queries?

2013-09-17 Thread Juan Daniel Santana Rodés
El 17/09/13 12:56, Igor Neyman escribió: -Original Message- From: Juan Daniel Santana Rodés [mailto:jdsant...@estudiantes.uci.cu] Sent: Tuesday, September 17, 2013 12:51 PM To: Igor Neyman Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] How to compare the results of two queries?

Re: [GENERAL] upgrade from 9.2.x to 9.3 causes significant performance degradation

2013-09-17 Thread Lonni J Friedman
On Tue, Sep 17, 2013 at 9:54 AM, Eduardo Morras wrote: > On Tue, 17 Sep 2013 09:19:29 -0700 > Lonni J Friedman wrote: > >> Greetings, >> I'm running a PostgreSQL 9.3.0 cluster (1 master with two streaming >> replication hot standby slaves) on RHEL6-x86_64. Yesterday I upgraded >> from 9.2.4 to 9

Re: [GENERAL] How to compare the results of two queries?

2013-09-17 Thread Kevin Grittner
Juan Daniel Santana Rodés wrote: > I am developing a task in which I need to know how to compare the > results of two queries ... > I thought about creating a procedure which both queries received by > parameters respectively. Then somehow able to run queries and return if > both have the same re

Re: [GENERAL] Connect postgres to SQLSERVER

2013-09-17 Thread John R Pierce
On 9/17/2013 11:05 AM, Agustin Larreinegabe wrote: Is there a way to connect to a sqlserver like dblink? I just need to execute a Procedure in sqlserver when something happen postgresql *is* a sql server.or do you mean Microsoft SQL Server ? -- john r pierce

Re: [GENERAL] upgrade from 9.2.x to 9.3 causes significant performance degradation

2013-09-17 Thread Jeff Janes
On Tue, Sep 17, 2013 at 11:22 AM, Lonni J Friedman wrote: > > > c) What does logs say? > > The postgres server logs look perfectly normal, minus a non-trivial > slower run time for most queries. There's nothing unusual in any of > the OS level logs (/var/log/messages, etc) or dmesg. > Are you ge

Re: [GENERAL] Connect postgres to SQLSERVER

2013-09-17 Thread Igor Neyman
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Agustin Larreinegabe Sent: Tuesday, September 17, 2013 2:06 PM To: PostgreSQL mailing lists Subject: [GENERAL] Connect postgres to SQLSERVER HI, Is there a way to connect to a sqlserver like dblink?

Re: [GENERAL] How to compare the results of two queries?

2013-09-17 Thread Igor Neyman
> -Original Message- > From: Juan Daniel Santana Rodés [mailto:jdsant...@estudiantes.uci.cu] > Sent: Tuesday, September 17, 2013 1:38 PM > To: Igor Neyman > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] How to compare the results of two queries? > > El 17/09/13 12:56, Igor Ne

Re: [GENERAL] Connect postgres to SQLSERVER

2013-09-17 Thread Atri Sharma
On Wed, Sep 18, 2013 at 12:11 AM, Igor Neyman wrote: > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Agustin Larreinegabe > Sent: Tuesday, September 17, 2013 2:06 PM > To: PostgreSQL mailing lists > Subject: [GENERAL] Connect postgres to SQLSE

Re: [GENERAL] ZFS snapshots - to use pg_start_backup() and pg_stop_backup() or no?

2013-09-17 Thread Vick Khera
On Wed, Sep 11, 2013 at 8:00 PM, Gregory Haase wrote: > Typically how fast is a crash recovery for a ~1TB database with heavy OTLP > load? Are we talking several seconds, several minutes, several hours? > This will depend on how fast your file system is, how frequent your checkpoints are (this is

Re: [GENERAL] Connect postgres to SQLSERVER

2013-09-17 Thread Rowan Collins
On 17/09/2013 19:05, Agustin Larreinegabe wrote: HI, Is there a way to connect to a sqlserver like dblink? I just need to execute a Procedure in sqlserver when something happen -- Gracias - Agustín Larreinegabe If all you want to do is trigger a single stored proc, one option

Re: [GENERAL] upgrade from 9.2.x to 9.3 causes significant performance degradation

2013-09-17 Thread Lonni J Friedman
Thanks for your reply. Comments/answers inline below On Tue, Sep 17, 2013 at 11:28 AM, Jeff Janes wrote: > On Tue, Sep 17, 2013 at 11:22 AM, Lonni J Friedman > wrote: >> >> >> > c) What does logs say? >> >> The postgres server logs look perfectly normal, minus a non-trivial >> slower run ti

Re: [GENERAL] ZFS snapshots - to use pg_start_backup() and pg_stop_backup() or no?

2013-09-17 Thread Gregory Haase
Thanks. If anyone is interested, I added postgresql to the zfstools project and the owner merged my pull request: https://github.com/bdrewery/zfstools I know there are probably 1000 ways to do this out there, but we were already using this code to manage our MySQL zfs snapshotting process, so ext

[GENERAL] Something Weird Going on with VACUUM ANALYZE

2013-09-17 Thread Shaun Thomas
Hey, This is PostgreSQL 9.1.9. So we've had "vacuumdb -avz" launched via cron at 3am for a few years now, and recently noticed some queries behaving very badly. While checking pg_stat_user_tables, I see this for several hundred of them: relname | last_analyze -

[GENERAL] Registration for the German-speaking PostgreSQL Conference is open

2013-09-17 Thread Andreas 'ads' Scherbaum
The German-speaking PostgreSQL Conference takes place in Oberhausen on November 8th. The registration is now open, please visit the website: http://2013.pgconf.de/ The keynote will be delivered by Peter van Hardenberg who talks about "The World's Largest Postgres Install". In sum we got subm

Re: [GENERAL] Why does this array query fail?

2013-09-17 Thread Ken Tanzer
> > Can we please follow list norms (or at least my example since I was the > first to respond) and bottom-post. Absolutely. Gmail did it without my realizing, but my bad and I'm all for following the list conventions. Thanks for taking the time to explain this stuff, which I appreciate. Mostl

Re: [GENERAL] Why does this array query fail?

2013-09-17 Thread David Johnston
Ken Tanzer wrote > 1) On what exactly does PG base its decision to interpret the ANY as > scalar or not? Or are you saying a sub-query will always be treated as > non-scalar, unless it is explicitly cast to an array? Correct. With respect to a sub-query inside ANY(...) it will be treated as non

Re: [GENERAL] upgrade from 9.2.x to 9.3 causes significant performance degradation

2013-09-17 Thread Andres Freund
Hi, On 2013-09-17 09:19:29 -0700, Lonni J Friedman wrote: > I'm running a PostgreSQL 9.3.0 cluster (1 master with two streaming > replication hot standby slaves) on RHEL6-x86_64. Yesterday I upgraded > from 9.2.4 to 9.3.0, and since the upgrade I'm seeing a significant > performance degradation.

Re: [GENERAL] Why does this array query fail?

2013-09-17 Thread Ken Tanzer
Thanks again David. I think that's all making sense to me now, except I want to follow up on your last point: Yes, un-nesting can make the problem go away though it too is unusual. For the > most part either use relations/sets or use arrays (for a specific > component of the schema). Your examp

Re: [GENERAL] upgrade from 9.2.x to 9.3 causes significant performance degradation

2013-09-17 Thread Lonni J Friedman
On Tue, Sep 17, 2013 at 3:47 PM, Andres Freund wrote: > Hi, > > On 2013-09-17 09:19:29 -0700, Lonni J Friedman wrote: >> I'm running a PostgreSQL 9.3.0 cluster (1 master with two streaming >> replication hot standby slaves) on RHEL6-x86_64. Yesterday I upgraded >> from 9.2.4 to 9.3.0, and since t

Re: [GENERAL] Unary Operators

2013-09-17 Thread Rowan Collins
On 15/09/2013 19:32, Andreas Ulbrich wrote: Salvete! I have the following problem. I'd like to define the operator symbol / as a left unary operator for reciprocal value of a number. I did this with a C-function and all the stuff around, but it does not work. Hiere is an extract and simplified

[GENERAL] Cannot commit when autoCommit is enabled error

2013-09-17 Thread Gurkan Ozfidan
Dear group, We have been using postgresql-jdbc-8.3-604, and recently we started using postgresql-jdbc-9.2, everything seems working fine, except we are getting this error and could not find the solution yet. This related to our reporting and I could say that it is not happening every report we run.

Re: [GENERAL] Why does this array query fail?

2013-09-17 Thread David Johnston
Ken Tanzer wrote > So I frequently have to provide information like "what were all the types > of services this client received during the last quarter?" or "show me all > the clients who received service X last year." I've learned enough to use > ANY, array_agg and unnest to get through these que

Re: [GENERAL] Unary Operators

2013-09-17 Thread David Johnston
Andreas Ulbrich wrote > create operator ^- (leftarg = float, procedure = reciproce); > works too, but > create operator / (leftarg = float, procedure = reciproce); > not. Do you mean the "^" operator or the "^-" operator? Rowan claims that "^" does not in fact work here... Rowan Collins wro

Re: [GENERAL] Why does this array query fail?

2013-09-17 Thread Ken Tanzer
Based on what you described, I think I've generally gone with option A. Conceptually I like B better, but it's generally more complicated and seems like overkill for simple checkbox-type options. (But as an aside, I am looking forward to the time when ELEMENT FKs overcome their performance issue

Re: [GENERAL] Why does this array query fail?

2013-09-17 Thread David Johnston
Ken Tanzer wrote > > SELECT client_id, > COALESCE( > (SELECT array_agg(code) FROM ( > SELECT distinct > client_id,unnest(accessed_health_care_non_urgent_codes) AS code > FROM service_reach > WHERE client_id=client.client_id > AND service_date BETWEEN '2013-08-01' AND '2013-

Re: [GENERAL] Why does this array query fail?

2013-09-17 Thread David Johnston
Ken Tanzer wrote > It's probably way more detail than you want, but I've attached the table > structure and pasted in a quarterly report that the query above was taken > from in case you have any pointers or are simply curious. Is this a quarterly report because that is how long it takes to run?