Re: [GENERAL] MinGW compiled client library

2013-08-16 Thread Albe Laurenz
Michael Cronenworth wrote: On 08/15/2013 10:59 AM, Michael Cronenworth wrote: The attached patches resolve the issue. Should I forward the patches on to the pgsql-hackers list for review or is this list sufficient? (First time PostgreSQL hacker.) Yes, any patches should be posted to

Re: [GENERAL] SSL connection has been closed unexpectedly

2013-08-16 Thread Albe Laurenz
Stuart Ford wrote: We have a problem on our development database server, which supports a PHP application, which connects to it from a different server. Sometimes, around 1 in 4 page loads, it fails and reports the following error message: FATAL: terminating connection due to administrator

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

2013-08-16 Thread Janek Sendrowski
Thanks for your Answers, my problem is, that there is no column with the name percentage. Its just a result of my query. So how can I use it anyway? ShouldI just store the result in a record variable and do another query? Janek Gesendet:Freitag, 16. August 2013 um 00:24 Uhr

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

2013-08-16 Thread salah jubeh
Hello, Use a view Regards From: Janek Sendrowski jane...@web.de To: pgsql-general@postgresql.org Sent: Friday, August 16, 2013 11:55 AM Subject: Re: [GENERAL] devide and summarize sql result (all) Thanks for your Answers,   my problem is, that there

Re: [GENERAL] Forcing materialize in the planner

2013-08-16 Thread Jack Christensen
Have you tried putting those components in a common table expression? I'm not sure if it absolutely forces the materialization or not, but in practice that has been my experience. Robert James wrote: I have a query which, when I materialize by hand some of its components, runs 10x faster

[GENERAL] what \ command actually run

2013-08-16 Thread Steve Clark
Hello, I seem to recall seeing somewhere that you can turn on an option that will let you see what the \ command actually run, but googling and doing a quick scan of the docs didn't turn it up. Could someone assist me on this? Thanks, -- Stephen Clark *NetWolves* Director of Technology Phone:

Re: [GENERAL] what \ command actually run

2013-08-16 Thread Adrian Klaver
On 08/16/2013 07:07 AM, Steve Clark wrote: Hello, I seem to recall seeing somewhere that you can turn on an option that will let you see what the \ command actually run, but googling and doing a quick scan of the docs didn't turn it up. Could someone assist me on this? psql -E

Re: [GENERAL] Commit problem in read-commited isolation level

2013-08-16 Thread Adrian Klaver
On 08/15/2013 10:45 PM, S H wrote: Any triggers on the table? There are no trigger associated with this table. FYI 8.1 is no longer supported. I understand that. If there are some known related issues, it will be easy to convince, Product mgmt team to upgrade the version of postgresql.

Re: [GENERAL] need help

2013-08-16 Thread David Johnston
Basavaraj wrote i have two unrelated tables as their is no common column to apply joins or anything, so i want to join those tables... I can understand being required to join them (for some unstated reason) but a simple want does not seem a strong enough reason to go through the pain...

[GENERAL] pg_get_triggerdef can't find the trigger using OID.

2013-08-16 Thread AI Rumman
Why can't pg_get_triggerdef find the trigger using OID. testdb=# SELECT testdb-# p.oid, testdb-# n.nspname as Schema, testdb-# p.proname as Name, testdb-# pg_catalog.pg_get_function_result(p.oid) as Result data type, testdb-# pg_catalog.pg_get_function_arguments(p.oid) as Argument data

Re: [GENERAL] Debugging Postgres?

2013-08-16 Thread Dennis
tcpdump and/or wireshark will help with detecting network issues. Wireshark is a little easier to grok if you are not used to doing packet dumps. http://www.wireshark.org/ Dennis From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Jayadevan M

Re: [GENERAL] SSL connection has been closed unexpectedly

2013-08-16 Thread Guy Helmer
On Aug 15, 2013, at 5:41 AM, Stuart Ford stuart.f...@glide.uk.com wrote: Dear community We have a problem on our development database server, which supports a PHP application, which connects to it from a different server. Sometimes, around 1 in 4 page loads, it fails and reports the

[GENERAL] need help

2013-08-16 Thread Basavaraj
i have two unrelated tables as their is no common column to apply joins or anything, so i want to join those tables using simple query(only two tables should be used and no common table) can you pls help me out how to do that. I am new user to postgres this is table format table1

Re: [GENERAL] pg_get_triggerdef can't find the trigger using OID.

2013-08-16 Thread bricklen
On Fri, Aug 16, 2013 at 8:01 AM, AI Rumman rumman...@gmail.com wrote: Why can't pg_get_triggerdef find the trigger using OID. testdb=# SELECT testdb-# p.oid, testdb-# n.nspname as Schema, testdb-# p.proname as Name, testdb-# pg_catalog.pg_get_function_result(p.oid) as Result data

Re: [GENERAL] devide and summarize sql result

2013-08-16 Thread Rob Sargent
Yeah, I have written that sort of query too, but with more info on tables and the SQL you are unlikely to get much help Sent from my iPad On Aug 15, 2013, at 2:46 PM, Janek Sendrowski jane...@web.de wrote: Hi, My sql query results sth. like this: user percentage franz 78%

Re: [GENERAL] Streaming Replication Randomly Locking Up

2013-08-16 Thread John DeSoi
On Aug 15, 2013, at 1:07 PM, Andrew Berman rexx...@gmail.com wrote: I'm having an issue where streaming replication just randomly stops working. I haven't been able to find anything in the logs which point to an issue, but the Postgres process shows a waiting status on the slave:

Re: [GENERAL] Streaming Replication Randomly Locking Up

2013-08-16 Thread Andrew Berman
Awesome, I'll give that a shot John. On Fri, Aug 16, 2013 at 8:39 AM, John DeSoi de...@pgedit.com wrote: On Aug 15, 2013, at 1:07 PM, Andrew Berman rexx...@gmail.com wrote: I'm having an issue where streaming replication just randomly stops working. I haven't been able to find anything

Re: [GENERAL] Streaming Replication Randomly Locking Up

2013-08-16 Thread Jeff Janes
On Thu, Aug 15, 2013 at 1:28 PM, Andrew Berman rexx...@gmail.com wrote: Hi Jeff, Here is the full process list at the time it stopped working (I have changed the actual username, db and IP for security). Would the idle in transaction process be the culprit? Most likely, yes. You should be

Re: [GENERAL] Streaming Replication Randomly Locking Up

2013-08-16 Thread Jeff Janes
On Fri, Aug 16, 2013 at 9:45 AM, Jeff Janes jeff.ja...@gmail.com wrote: On Thu, Aug 15, 2013 at 1:28 PM, Andrew Berman rexx...@gmail.com wrote: Hi Jeff, Here is the full process list at the time it stopped working (I have changed the actual username, db and IP for security). Would the idle

Re: [GENERAL] Streaming Replication Randomly Locking Up

2013-08-16 Thread Andrew Berman
Ok, next time it happens I'll try to do more sleuthing to figure out if that's the issue. For now, I'm going to try adding --timeout=30 to the rsync command and see if that fixes things. Thanks again for your help! Andrew On Fri, Aug 16, 2013 at 10:12 AM, Jeff Janes jeff.ja...@gmail.com

[GENERAL] Listing privileges on a schema

2013-08-16 Thread David Salisbury
Hello, Is there a query out there where I can get a list of permissions associated to a schema? Something like the below query that I can do for a table, but for a schema instead? SELECT grantee, privilege_type FROM

Re: [GENERAL] Listing privileges on a schema

2013-08-16 Thread Adrian Klaver
On 08/16/2013 10:27 AM, David Salisbury wrote: Hello, Is there a query out there where I can get a list of permissions associated to a schema? Something like the below query that I can do for a table, but for a schema instead? SELECT grantee, privilege_type FROM

[GENERAL] Using an index to materialize a function

2013-08-16 Thread Robert James
If I have a slow_function(), and I create an index of slow_function(field), will Postgres use that index to avoid having to recompute the function? Example: SELECT slow_function(field1) FROM table1 WHERE id = 5 It won't use the index on field1 to _find_ the record. Can it use it to compute the

[GENERAL] Does string a begin with string b?

2013-08-16 Thread Robert James
What's the best way to check if string a begins with string b? Both a and b are coming from fields in a table. Requirements: * Either a or b might have special chars (such as '%') in them which should NOT do anything special - they're just plain strings, not regular expressions. * a and b can

Re: [GENERAL] need help

2013-08-16 Thread John R Pierce
On 8/16/2013 6:35 AM, Basavaraj wrote: finally the result shoule be name| address|email|mobileNo|firstname|lastName| -- abc some1mail1 1234564 def xyz 5 records | 10 records |

Re: [GENERAL] Does string a begin with string b?

2013-08-16 Thread Jeff Janes
On Fri, Aug 16, 2013 at 11:04 AM, Robert James srobertja...@gmail.com wrote: What's the best way to check if string a begins with string b? Both a and b are coming from fields in a table. Requirements: * Either a or b might have special chars (such as '%') in them which should NOT do

Re: [GENERAL] Using an index to materialize a function

2013-08-16 Thread Kevin Grittner
Robert James srobertja...@gmail.com wrote: If I have a slow_function(), and I create an index of slow_function(field), will Postgres use that index to avoid having to recompute the function? Example: SELECT slow_function(field1) FROM table1 WHERE id = 5 It won't use the index on field1

[GENERAL] Select performance variation based on the different combinations of using where lower(), order by, and limit

2013-08-16 Thread Tyler Reese
I have a table that has around 8 million rows. The table has 71 columns and 33 indexes. The relevant indexes are: callingpartynumber btree (CallingPartyNumber) callingpartynumber_lower btree (lower(CallingPartyNumber) text_pattern_ops) My question is about the explain analyze output, below. In

Re: [GENERAL] Using an index to materialize a function

2013-08-16 Thread Tom Lane
Kevin Grittner kgri...@ymail.com writes: Robert James srobertja...@gmail.com wrote: If I have a slow_function(), and I create an index of slow_function(field), will Postgres use that index to avoid having to recompute the function? Example: SELECT slow_function(field1) FROM table1 WHERE id

Re: [GENERAL] MinGW compiled client library

2013-08-16 Thread Michael Cronenworth
On 08/16/2013 02:12 AM, Albe Laurenz wrote: Yes, any patches should be posted to -hackers, in this case with a archive reference to the discussion on -general. Please readhttp://wiki.postgresql.org/wiki/Submitting_a_Patch To make sure that the patch does not get lost, add it to the next

Re: [GENERAL] Seemingly inconsistent ORDER BY behavior

2013-08-16 Thread BladeOfLight16
On Wed, Aug 14, 2013 at 2:56 PM, Tom Lane t...@sss.pgh.pa.us wrote: Our interpretation is that a bare column name (ORDER BY foo) is resolved first as an output-column label, or failing that as an input-column name. However, as soon as you embed a name in an expression, it will be treated

Re: [GENERAL] Seemingly inconsistent ORDER BY behavior

2013-08-16 Thread Scott Marlowe
On Fri, Aug 16, 2013 at 8:37 PM, BladeOfLight16 bladeofligh...@gmail.com wrote: On Wed, Aug 14, 2013 at 2:56 PM, Tom Lane t...@sss.pgh.pa.us wrote: Our interpretation is that a bare column name (ORDER BY foo) is resolved first as an output-column label, or failing that as an input-column name.

Re: [GENERAL] Commit problem in read-commited isolation level

2013-08-16 Thread S H
1) What is your exact Postgres version i.e 8.1.5.? V - 8.1.18 3) You also say it works fine in two environments, but not one. What are the environments? OS and version, memory, Postgres versions, etc. It is working on most of the production system ( more than 100) but failed once in one of