Re: [GENERAL] Postgres fails to start

2015-04-07 Thread Haiming Zhang
Hi Michael, Thank you again. It seems hard to recover, I will go the hard way (lost data). Learned a lesson. Regards, Haiming -Original Message- From: Michael Paquier [mailto:michael.paqu...@gmail.com] Sent: Tuesday, 7 April 2015 1:04 PM To: Haiming Zhang Cc:

Re: [GENERAL] [SQL] check data for datatype

2015-04-07 Thread Gerardo Herzig
I guess that could need something like (untested) delete from bigtable text_column !~ '^[0-9][0-9]*$'; HTH Gerardo - Mensaje original - De: Suresh Raja suresh.raja...@gmail.com Para: pgsql-general@postgresql.org, pgsql-...@postgresql.org Enviados: Viernes, 27 de Marzo 2015 15:08:43

Re: [GENERAL] Postgresql Development Options

2015-04-07 Thread Ray Madigan
On Sun, Apr 5, 2015 at 6:46 PM, Steve Atkins st...@blighty.com wrote: On Apr 5, 2015, at 1:21 PM, Ray Madigan raymond.madi...@gmail.com wrote: I have been using postgresql in java off and on for many years. I now have an assignemtn where I have to build a very straight forward networked

Re: [GENERAL] Problems with casting

2015-04-07 Thread Tom Lane
Jim Nasby jim.na...@bluetreble.com writes: On 4/7/15 4:17 PM, Tom Lane wrote: I suspect that that's only the tip of the iceberg. Remember the mess we had with implicit casts to text? And those only existed for a dozen or so types, not for everything. Every function or operator you define

Re: [GENERAL] Problems with casting

2015-04-07 Thread Jim Nasby
On 4/7/15 4:17 PM, Tom Lane wrote: Jim Nasby jim.na...@bluetreble.com writes: I've created a variant data type [1]. It seems to work pretty well, except for some issues with casting. Since the idea of the type is to allow storing any other data type, it creates casts to and from all other

[GENERAL] Problems with casting

2015-04-07 Thread Jim Nasby
I've created a variant data type [1]. It seems to work pretty well, except for some issues with casting. Since the idea of the type is to allow storing any other data type, it creates casts to and from all other types. At first these were all marked as ASSIGNMENT, but that made using variant

Re: [GENERAL] Problems with casting

2015-04-07 Thread Tom Lane
Jim Nasby jim.na...@bluetreble.com writes: I've created a variant data type [1]. It seems to work pretty well, except for some issues with casting. Since the idea of the type is to allow storing any other data type, it creates casts to and from all other types. At first these were all

Re: [GENERAL] [SQL] check data for datatype

2015-04-07 Thread Jim Nasby
On 4/7/15 11:59 AM, Gerardo Herzig wrote: I guess that could need something like (untested) delete from bigtable text_column !~ '^[0-9][0-9]*$'; Won't work for... .1 -1 1.1e+5 ... Really you need to do something like what Jerry suggested if you want this to be robust. -- Jim Nasby, Data

Re: [GENERAL] Serializable transaction restart/re-execute

2015-04-07 Thread Jim Nasby
On 4/6/15 6:42 AM, Bill Moran wrote: CREATE OR REPLACE FUNCTION mytest() RETURNS integer AS $$ BEGIN update account set balance = balance+10 where id=1 RETURNING balance; END $$ LANGUAGE SQL; of course, it's unlikely that you'll ever want to wrap such a simple query in a function, so I'm

Re: [GENERAL] Problems with casting

2015-04-07 Thread Jim Nasby
On 4/7/15 4:35 PM, Tom Lane wrote: Jim Nasby jim.na...@bluetreble.com writes: On 4/7/15 4:17 PM, Tom Lane wrote: I suspect that that's only the tip of the iceberg. Remember the mess we had with implicit casts to text? And those only existed for a dozen or so types, not for everything. Every

Re: [GENERAL] Basic Question on Point In Time Recovery

2015-04-07 Thread Jim Nasby
On 3/11/15 6:46 AM, Andrew Sullivan wrote: Is our current frequent pg_dump approach a sensible way to go about things. Or are we missing something? Is there some other way to restore one database without affecting the others? Slony-I, which is a PITA to administer, has a mode where you can

Re: [GENERAL] Asynchronous replication in postgresql

2015-04-07 Thread Chris Winslett
I've recently open sourced this template for managing state for PostgreSQL: https://github.com/compose/governor Take a test drive around it. As long as the old Leader is verifiably dead or stopped at the forked WAL log point, I've not had issues with inserting a `recovery.conf` to tail the new

Re: [GENERAL] Problems with casting

2015-04-07 Thread Jim Nasby
On 4/7/15 5:56 PM, David G. Johnston wrote: On Tue, Apr 7, 2015 at 3:09 PM, Jim Nasby jim.na...@bluetreble.com mailto:jim.na...@bluetreble.comwrote: On 4/7/15 4:35 PM, Tom Lane wrote: Jim Nasby jim.na...@bluetreble.com writes: On 4/7/15 4:17 PM, Tom Lane wrote:

Re: [GENERAL] Asynchronous replication in postgresql

2015-04-07 Thread Jim Nasby
On 3/11/15 5:27 AM, Deole, Pushkar (Pushkar) wrote: Hi, I am new to postgresql and evaluating the streaming replication for my use case. My use case is: 1.Need to replicate data from primary database (master) to secondary database (slave) asynchronously. 2.If master goes down, the slave

Re: [GENERAL] Benchmarking partitioning triggers and rules

2015-04-07 Thread Jim Nasby
On 3/12/15 8:15 AM, Tomas Vondra wrote: On 12.3.2015 04:57, Tim Uckun wrote: I am using postgres 9.4, the default install with brew install postgres, no tuning at all. BTW if I use postgres.app application the benchmarks run twice as slow! I have no idea what brew or postgres.app is. But I

Re: [GENERAL] Working with Array of Composite Type

2015-04-07 Thread Jim Nasby
On 3/28/15 9:36 AM, Jan de Visser wrote: On March 28, 2015 06:18:49 PM Alex Magnum wrote: Hello, I am struggling with finding the right way to deal with arrays of composite types. Bellow is an example of the general setup where I defined an image type to describe the image properties. A user

Re: [GENERAL] Problems with casting

2015-04-07 Thread Tom Lane
Jim Nasby jim.na...@bluetreble.com writes: On 4/7/15 4:35 PM, Tom Lane wrote: Just out of curiosity, what's the point of this type at all, compared to anyelement and friends? The two big differences are that you can store a variant in a table (with reasonable protection against things like

Re: [GENERAL] Problems with casting

2015-04-07 Thread David G. Johnston
On Tue, Apr 7, 2015 at 3:09 PM, Jim Nasby jim.na...@bluetreble.com wrote: On 4/7/15 4:35 PM, Tom Lane wrote: Jim Nasby jim.na...@bluetreble.com writes: On 4/7/15 4:17 PM, Tom Lane wrote: I suspect that that's only the tip of the iceberg. Remember the mess we had with implicit casts to

Re: [GENERAL] autovacuum worker running amok - and me too ;)

2015-04-07 Thread Jim Nasby
On 3/9/15 3:56 AM, wambacher wrote: Hi paul just found my system (24 GB Mem, 72 GB Swap) running nearly at it's limits: The current vaccum is using 66.7 GB (sixty-six dot seven) GB of memory and my System is nearly down. I'm sorry, but that must be an bug. Remember: It's the Analyze of an

Re: [GENERAL] Would like to know how analyze works technically

2015-04-07 Thread Jim Nasby
On 4/2/15 2:18 PM, TonyS wrote: On Wed, April 1, 2015 5:50 pm, Tom Lane-2 [via PostgreSQL] wrote: TonyS [hidden email] /user/SendEmail.jtp?type=nodenode=5844517i=0 writes: The analyze function has crashed again while the overcommit entries were as above. The last bit of the

Re: [GENERAL] could not split GIN page; no new items fit

2015-04-07 Thread Jim Nasby
On 4/4/15 8:38 AM, Chris Curvey wrote: On Fri, Apr 3, 2015 at 9:27 PM, Tom Lane t...@sss.pgh.pa.us mailto:t...@sss.pgh.pa.us wrote: Chris Curvey ch...@chriscurvey.com mailto:ch...@chriscurvey.com writes: Hmm, I'm trying to create a gin index, thusly: create index foo_idx on

Re: [GENERAL] could not split GIN page; no new items fit

2015-04-07 Thread Tom Lane
Jim Nasby jim.na...@bluetreble.com writes: On 4/4/15 8:38 AM, Chris Curvey wrote: I can! I just copied the data to a new table, obfuscated the sensitive parts, and was able to reproduce the error. I can supply the script to create and populate the table, but that's still clocking in at 250Mb

Re: [GENERAL] could not split GIN page; no new items fit

2015-04-07 Thread Jim Nasby
On 4/7/15 11:58 PM, Tom Lane wrote: Jim Nasby jim.na...@bluetreble.com writes: On 4/4/15 8:38 AM, Chris Curvey wrote: I can! I just copied the data to a new table, obfuscated the sensitive parts, and was able to reproduce the error. I can supply the script to create and populate the table,

Re: [GENERAL] Benchmarking partitioning triggers and rules

2015-04-07 Thread Tim Uckun
I understand that there is overhead involved in parsing the strings and such. The amount of overhead was surprising to me but that's another matter. What I am really puzzled about is the difference between the statements EXECUTE 'INSERT INTO ' || quote_ident(partition_name) || ' SELECT

Re: [GENERAL] Benchmarking partitioning triggers and rules

2015-04-07 Thread Adrian Klaver
On 04/07/2015 07:49 PM, Tim Uckun wrote: I understand that there is overhead involved in parsing the strings and such. The amount of overhead was surprising to me but that's another matter. What I am really puzzled about is the difference between the statements EXECUTE 'INSERT INTO ' ||