Re: [GENERAL] FW: getting error while running sql on mm_activealrm table

2014-12-09 Thread M Tarkeshwar Rao
Is column size less than 8 kb will help us? -Original Message- From: M Tarkeshwar Rao Sent: 10 December 2014 11:51 To: 'Adrian Klaver'; 'pgsql-general@postgresql.org' Subject: RE: [GENERAL] FW: getting error while running sql on mm_activealrm table Hi all, We have done all the suggeste

Re: [GENERAL] FW: getting error while running sql on mm_activealrm table

2014-12-09 Thread M Tarkeshwar Rao
Hi all, We have done all the suggested things from reindex and vaccume to hardware heat issue. But do not get the clue why this happened? Can you please suggest what are the checkpoints we follow so that we can avoid this kind of issue in future? Regards Tarkeshwar -Original Message

Re: [GENERAL] Idle Sessions inTransaction with RELEASE_EXEC_SVP queries and locks

2014-12-09 Thread Sameer Kumar
On 10 Dec 2014 08:52, wrote: > > ​I am having a problem with having idle sessions in transactions. In pgAdmin Server Status, it is showing "RELEASE_EXEC_SVP_XX" (XX data are varied) as its query and it's locks also contain a lot of these "RELEASE_EXEC_SVP_XX" entries. What do these mea

Re: [GENERAL] Weird CPU utilization patterns with Postgres

2014-12-09 Thread Peter Geoghegan
On Tue, Dec 9, 2014 at 5:46 PM, Peter Geoghegan wrote: > I'm currently trying to fix this across the board [1], but my first > suggestion is to try enabling log_temp_files to see if external sorts > can be correlated with these stalls. See also: http://www.postgresql.org/message-id/cam3swztijobp

Re: [GENERAL] Weird CPU utilization patterns with Postgres

2014-12-09 Thread Peter Geoghegan
On Fri, Dec 5, 2014 at 5:14 PM, István wrote: > I am wondering why the root cause might be here. My guess would be that an important text-based sort operation began to go to disk. The external sort code (tapesort) is known to do far more comparisons than quicksort. With text sorts, you tend to se

[GENERAL] Weird CPU utilization patterns with Postgres

2014-12-09 Thread István
Hi, We are having a really interesting problem with our Postgres 9.3 instance in our infrastructure. Few days ago our box started to show huge CPU spikes while the IO Wait is negligible on the box. After a while I have installed perf and started to monitor the Postgres master process and here is

Re: [GENERAL] Use cases for lateral that do not involve a set returning function

2014-12-09 Thread AJ Welch
Thanks for the response. Yea, using lateral there definitely reads better to me than using a correlated subquery. And it makes sense that performance is ok since you're filtering on a specific person's id (as you hinted at with `WHERE p.id = ...`) and the nested loop forced by `order by...limit 1`

Re: Fwd: Fwd: [GENERAL] Problem with pg_dump and decimal mark

2014-12-09 Thread Eric Svenson
Hi Adrian, here are the results of today: > How where the Postgres instances installed? > From a package? Yes. It is Version 9.2 for Windows, comment of the package is "The PostgreSQL RDBMS, version 9.2, packaged by EnterpriseDB" > Compiled and if so with what compiler and what settings? No

[GENERAL] Idle Sessions inTransaction with RELEASE_EXEC_SVP queries and locks

2014-12-09 Thread chris . jurado
​I am having a problem with having idle sessions in transactions. In pgAdmin Server Status, it is showing "RELEASE_EXEC_SVP_XX" (XX data are varied) as its query and it's locks also contain a lot of these "RELEASE_EXEC_SVP_XX" entries. What do these mean? These commonly cause lock b

Re: Fwd: Fwd: [GENERAL] Problem with pg_dump and decimal mark

2014-12-09 Thread Eric Svenson
Hi Adrian, I try to get access to the non-VM machine, at the moment access is not possible for me unfortunately. You are right, there are more tables in the database which are restored correctly but these tables do NOT contain float values. These two tables are the only tables in the database whi

Re: [GENERAL] pg_restore -n sch1 : schema "sch1" does not exist

2014-12-09 Thread Adrian Klaver
On 12/09/2014 07:29 AM, lin wrote: Hi,all: I create a schema (sch1) in the database of db1, and I also create a table sch1.t1, then I use the comand "pg_dump -d db1 -Fd -f dir1" to back up the database of db1; at lase I drop the schema of sch1; I want to restore the schema sch1, but wh

Re: [GENERAL] pg_restore -n sch1 : schema "sch1" does not exist

2014-12-09 Thread lin
Are you sure it is a bug and you have fixed it? I test it with postgresql-9.4rcl, the result is the same with postgresql-9.3 beta2. At 2014-12-09 23:54:01, "Tom Lane" wrote: >lin writes: >> I create a schema (sch1) in the database of db1, and I also create a >> table sch1.t1, the

Re: [GENERAL] Speeding up an in-progress wraparound-preventing vacuum

2014-12-09 Thread Tom Lane
Vincent de Phily writes: > What happens when vacuum is killed before it had time to go though the index > with its dead-TID buffer ? The next run will go through the index again, looking for those same TIDs (and possibly more). regards, tom lane -- Sent via pgsql-gene

Re: [GENERAL] Speeding up an in-progress wraparound-preventing vacuum

2014-12-09 Thread Vincent de Phily
On Tuesday 09 December 2014 16:56:39 Tom Lane wrote: > Vincent de Phily writes: > > It reads about 8G of the table (often doing a similar number of writes, > > but > > not always), then starts reading the pkey index and the second index (only > > 2 indexes on this table), reading both of them full

Re: [GENERAL] Updating single/multiple fields of JSON document

2014-12-09 Thread Roxanne Reid-Bennett
On 12/9/2014 3:38 PM, Bruce Momjian wrote: On Mon, Dec 8, 2014 at 04:56:00PM +0530, bln prasad wrote: Hi, Is there any way to update single/multiple fields of JSON document of a column? No, not yet. We are thinking of options but don't have any work in progress. Given a pretty distinct w

Re: [GENERAL] List of shorthand casts

2014-12-09 Thread FarjadFarid(ChkNet)
Thanks. -Original Message- From: Adrian Klaver [mailto:adrian.kla...@aklaver.com] Sent: 09 December 2014 21:46 To: FarjadFarid(ChkNet); 'David G Johnston'; pgsql-general@postgresql.org Subject: Re: [GENERAL] List of shorthand casts On 12/09/2014 01:37 PM, FarjadFarid(ChkNet) wrote: > H

Re: [GENERAL] Speeding up an in-progress wraparound-preventing vacuum

2014-12-09 Thread Tom Lane
Vincent de Phily writes: > It reads about 8G of the table (often doing a similar number of writes, but > not always), then starts reading the pkey index and the second index (only 2 > indexes on this table), reading both of them fully (some writes as well, but > not as many as for the table), w

Re: [GENERAL] List of shorthand casts

2014-12-09 Thread FarjadFarid(ChkNet)
Got it thanks. -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Tom Lane Sent: 09 December 2014 21:40 To: FarjadFarid(ChkNet) Cc: 'David G Johnston'; pgsql-general@postgresql.org Subject: Re: [GENERAL] List of shorthand

Re: [GENERAL] Speeding up an in-progress wraparound-preventing vacuum

2014-12-09 Thread Vincent de Phily
On Tuesday 09 December 2014 01:58:11 Vincent de Phily wrote: > On Monday 08 December 2014 10:17:37 Jeff Janes wrote: > > You can `strace` for the lseek command to see which file handles it is > > currently working on, and > > use lsof to turn those into names. You want to look at where it is in th

Re: [GENERAL] List of shorthand casts

2014-12-09 Thread Adrian Klaver
On 12/09/2014 01:37 PM, FarjadFarid(ChkNet) wrote: Hi David, I mean the ones with "::" like ::text or ::uuid etc Some of Postgresql data types have two words or more like "double precision" or " timestamp without time zone". It is not clear how these are implemented if at all. Try the query

Re: [GENERAL] List of shorthand casts

2014-12-09 Thread Tom Lane
"FarjadFarid\(ChkNet\)" writes: > I mean the ones with "::" like ::text or ::uuid etc > Some of Postgresql data types have two words or more like "double precision" > or " timestamp without time zone". It is not clear how these are > implemented if at all. Any type name works fine after "::".

Re: [GENERAL] List of shorthand casts

2014-12-09 Thread FarjadFarid(ChkNet)
Hi David, I mean the ones with "::" like ::text or ::uuid etc Some of Postgresql data types have two words or more like "double precision" or " timestamp without time zone". It is not clear how these are implemented if at all. Many thank. -Original Message- From: pgsql-general-ow...@p

Re: [GENERAL] Updating single/multiple fields of JSON document

2014-12-09 Thread Bruce Momjian
On Mon, Dec 8, 2014 at 04:56:00PM +0530, bln prasad wrote: > Hi, >    Is there any way to update single/multiple fields of JSON document of a > column? No, not yet. We are thinking of options but don't have any work in progress. -- Bruce Momjian http://momjian.us EnterpriseDB

Re: [GENERAL] List of shorthand casts

2014-12-09 Thread David G Johnston
FarjadFarid(ChkNet) wrote > Is the list of shorthand casts documented somewhere? > If so can you please direct me to it. A working URL would be great. Do you mean implicit casts - those that do not require an explicit CAST(...) or "::" in the query? Can you give an example of one that you know

[GENERAL] List of shorthand casts

2014-12-09 Thread FarjadFarid(ChkNet)
Is the list of shorthand casts documented somewhere? If so can you please direct me to it. A working URL would be great. Many thanks. -- 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] Help Optimizing a Summary Query

2014-12-09 Thread Arthur Silva
On Tue, Dec 9, 2014 at 4:18 PM, Robert DiFalco wrote: > I'm sorry, I missed a JOIN on the second variation. It is: > > SELECT u.id, u.name, u.imageURL, u.bio, >CASE > WHEN f.friend_id IS NOT NULL THEN 'isFriend' > WHEN s.to_id IS NOT NULL THEN 'hasSentRequest' > WHEN r.to_id

Re: [GENERAL] Streaming Replication - changing IP addresses

2014-12-09 Thread John R Pierce
On 12/9/2014 9:07 AM, Dara Unglaube wrote: Is this neccessary? What is the benefit of having the archive on? Could I map a network drive from the slave to the master and set the archive_command to that mapped drive? Or what would be the best approach for this? having a wal archive lets the s

Re: [GENERAL] Help Optimizing a Summary Query

2014-12-09 Thread Robert DiFalco
I'm sorry, I missed a JOIN on the second variation. It is: SELECT u.id, u.name, u.imageURL, u.bio, CASE WHEN f.friend_id IS NOT NULL THEN 'isFriend' WHEN s.to_id IS NOT NULL THEN 'hasSentRequest' WHEN r.to_id IS NOT NULL THEN 'hasReceivedRequest' ELSE 'none' END AS 'f

Re: [GENERAL] Streaming Replication - changing IP addresses

2014-12-09 Thread Dara Unglaube
Thank so very for the info, John! This will help a lot to have it set up locally. I have it set up across the local network and double checked with pg_stat_replication and it was using the local IP. But now I am not sure about the "archive_command" command on the master. We had it set up to archiv

Re: [GENERAL] pg_restore -n sch1 : schema "sch1" does not exist

2014-12-09 Thread Tom Lane
lin writes: > I create a schema (sch1) in the database of db1, and I also create a > table sch1.t1, then I use the comand "pg_dump -d db1 -Fd -f dir1" to back up > the database of db1; at lase I drop the schema of sch1; I want to restore > the schema sch1, but when I execute the comma

[GENERAL] pg_restore -n sch1 : schema "sch1" does not exist

2014-12-09 Thread lin
Hi,all: I create a schema (sch1) in the database of db1, and I also create a table sch1.t1, then I use the comand "pg_dump -d db1 -Fd -f dir1" to back up the database of db1; at lase I drop the schema of sch1; I want to restore the schema sch1, but when I execute the command "pg_restor

Re: [GENERAL] Removing duplicate records from a bulk upload (rationale behind selecting a method)

2014-12-09 Thread Daniel Begin
Thank Tom, I understand that the rationale behind choosing to create a new table from distinct records is that, since both approaches need full table scans, selecting distinct records is faster (and seems more straight forward) than finding/deleting duplicates; Best regards, Daniel -Origina

Re: [GENERAL] Use cases for lateral that do not involve a set returning function

2014-12-09 Thread Albe Laurenz
AJ Welch wrote: > http://blog.heapanalytics.com/postgresqls-powerful-new-join-type-lateral/ > > I suspected some of the claims in the post may not have been accurate. This > one in particular: > > "Without lateral joins, we would need to resort to PL/pgSQL to do this > analysis. Or, if our data