Re: [GENERAL] EXCLUDE constraint with not equals

2015-02-09 Thread Thomas Kellerer
Kai Groner schrieb am 10.02.2015 um 01:38: > Given the following table, I would like to ensure that all the rows for an > email that have a user defined map to the same user. > > CREATE TABLE person ( > id INTEGER PRIMARY KEY, > user TEXT, > email TEXT NOT NULL); > > > What I think I'm l

Re: [GENERAL] Logical Decoding Callbacks

2015-02-09 Thread Michael Paquier
On Tue, Feb 10, 2015 at 9:52 AM, Xavier Stevens wrote: > I'm trying to write a logical decoding plugin and I'm seeing some > interesting behavior around the startup callback. When I use psql and the > built-in SQL functions (like pg_logical_slot_peek_changes) to use my module > I see the startup_cb

[GENERAL] Logical Decoding Callbacks

2015-02-09 Thread Xavier Stevens
I'm trying to write a logical decoding plugin and I'm seeing some interesting behavior around the startup callback. When I use psql and the built-in SQL functions (like pg_logical_slot_peek_changes) to use my module I see the startup_cb get called. I have written my own streaming replication client

[GENERAL] EXCLUDE constraint with not equals

2015-02-09 Thread Kai Groner
Hello, Given the following table, I would like to ensure that all the rows for an email that have a user defined map to the same user. CREATE TABLE person ( id INTEGER PRIMARY KEY, user TEXT, email TEXT NOT NULL); What I think I'm looking for is something like this: CREATE TABLE person (

Re: [GENERAL] Mult-standby streaming replication master failover

2015-02-09 Thread Michael Paquier
On Tue, Feb 10, 2015 at 1:26 AM, Vladislav Tchernev wrote: > I am trying to figure out a clear way to preform a post-disaster (where the > master hasn't had the chance to shut down properly) master failover in a > multi-standby streaming replication setup. I found a couple of old posts > suggestin

Re: [GENERAL] Partioning with overlapping and non overlapping constraints

2015-02-09 Thread Tim Uckun
This approach wouldn't work I think. The data keeps growing in the "hot" table. On Tue, Feb 10, 2015 at 6:01 AM, Melvin Davidson wrote: > Well, without knowing too much about your application, it certainly sounds > like using the metricts_MMDD is the way to go. As for modifying the > constr

Re: [GENERAL] Partioning with overlapping and non overlapping constraints

2015-02-09 Thread Tim Uckun
>Don't you have duplicate information within your UTC, location and local_time data ? Maybe you can just attach a timezone to each location... Yes there is duplicate information but dealing with time zones are a PITA and the easiest way to solve the myriad of problems I have is to store the local

Re: [GENERAL] Cluster seems broken after pg_basebackup

2015-02-09 Thread Guillaume Drolet
2015-02-09 16:10 GMT-05:00 Jim Nasby : > On 2/9/15 11:51 AM, Guillaume Lelarge wrote: > >> According to this page >> , exception >> 0xC005 means STATUS_ACCESS_VIOLATION - The instruction at 0x%08lx >> referenced memory at 0x%08lx. The mem

Re: [GENERAL] Partioning with overlapping and non overlapping constraints

2015-02-09 Thread Brent Wood
Hi Mark, We have a somewhat similar situation - we have years of continuous data which are managed in Postgis. The tables are partitioned into annual subsets. The previous (static) years' underlying tables have a clustered index on UTC timestamp, the current year table has a conventional index.

Re: [GENERAL] Cluster seems broken after pg_basebackup

2015-02-09 Thread Jim Nasby
On 2/9/15 11:51 AM, Guillaume Lelarge wrote: According to this page , exception 0xC005 means STATUS_ACCESS_VIOLATION - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s. This is not of much help to me.

Re: [GENERAL] Question on session_replication_role

2015-02-09 Thread Jim Nasby
On 2/3/15 4:57 PM, Vasudevan, Ramya wrote: -> Append (cost=0.00..1748.87 rows=17 width=8) (actual time=11.454..11.454 rows=1 loops=1847) Buffers: shared hit=1093445 read=538 I/O Timings: read=21.060 -> Seq Scan on emailsubscription.reg

Re: [GENERAL] Cluster seems broken after pg_basebackup

2015-02-09 Thread Adrian Klaver
On 02/09/2015 08:34 AM, Guillaume Drolet wrote: CCing list so the information stays in the thread. 2015-02-06 18:44 GMT-05:00 Adrian Klaver mailto:adrian.kla...@aklaver.com>>: On 02/06/2015 09:17 AM, Guillaume Drolet wrote: Dear Adrian, Thanks for helping me. Sorry for t

[GENERAL] Building proper static library libpq.a

2015-02-09 Thread Jeroen Ooms
I am working on bindings to libpq for the R programming language. For windows I need to build libpq.a as a standalone static library (using mingw-w64) that I can link into the client application. I have done this for many other libraries (e.g. libmariadbclient) but I am having difficulty generating

Re: [GENERAL] Cluster seems broken after pg_basebackup

2015-02-09 Thread Guillaume Drolet
Guillaume: the cluster I try to start is the one used with pg_basebackup, not the result of the backup. 2015-02-09 12:51 GMT-05:00 Guillaume Lelarge : > 2015-02-09 18:40 GMT+01:00 Guillaume Drolet : > >> I tried starting the cluster again. Once again everything looked fine at >> the start (first

Re: [GENERAL] Cluster seems broken after pg_basebackup

2015-02-09 Thread Guillaume Lelarge
2015-02-09 18:40 GMT+01:00 Guillaume Drolet : > I tried starting the cluster again. Once again everything looked fine at > the start (first three lines of this log, in English this time): > > 2015-02-09 11:40:55 EST LOG: database system was shut down at 2015-02-06 > 09:50:21 EST > 2015-02-09 11:4

Re: [GENERAL] Cluster seems broken after pg_basebackup

2015-02-09 Thread Guillaume Drolet
I tried starting the cluster again. Once again everything looked fine at the start (first three lines of this log, in English this time): 2015-02-09 11:40:55 EST LOG: database system was shut down at 2015-02-06 09:50:21 EST 2015-02-09 11:40:55 EST LOG: database system is ready to accept connecti

Re: [GENERAL] Partioning with overlapping and non overlapping constraints

2015-02-09 Thread Melvin Davidson
Well, without knowing too much about your application, it certainly sounds like using the metricts_MMDD is the way to go. As for modifying the constraint daily, couldn't you just use where timestamp > current_date - Interval '1 Day' ? On Mon, Feb 9, 2015 at 5:14 AM, Marc Mamin wrote: > > >

Re: [GENERAL] Cluster seems broken after pg_basebackup

2015-02-09 Thread Guillaume Drolet
2015-02-07 1:24 GMT-05:00 Guillaume Lelarge : > Le 6 févr. 2015 17:31, "Adrian Klaver" a > écrit : > > > > On 02/06/2015 05:03 AM, Guillaume Drolet wrote: > >> > >> Hi, > >> > >> Yesterday I ran a pg_basebackup of my cluster. Since it has completed, > >> my cluster doesn't work properly. I tried

[GENERAL] Mult-standby streaming replication master failover

2015-02-09 Thread Vladislav Tchernev
Hello All, I am trying to figure out a clear way to preform a post-disaster (where the master hasn't had the chance to shut down properly) master failover in a multi-standby streaming replication setup. I found a couple of old posts suggesting that the choice of the new master is very important and

Re: [GENERAL] Stability of JSON textual representation

2015-02-09 Thread David Evans
On 9 February 2015 at 03:57, Gavin Flower wrote: > > Would using jsonb be more consistent? > Yes, casting to jsonb seems produce consistent output: # SELECT array_to_json(array[1, 2, 3])::jsonb, json_build_array(1, 2, 3)::jsonb; array_to_json | json_build_array ---+

Re: [GENERAL] Change postgresql encoding

2015-02-09 Thread Oliver
2015-02-09 14:01 GMT+00:00 Vincent Veyron : > On Mon, 9 Feb 2015 08:11:25 + > Oliver wrote: > > > 2015-02-09 7:52 GMT+00:00 Oliver : > > > > > regional configuration name not valid <> > > > SQL state: 42809 > > > > > > I've tried es_ES.iso8859-15 and same error. > > > > > If I set encoding to

Re: [GENERAL] Change postgresql encoding

2015-02-09 Thread Vincent Veyron
On Mon, 9 Feb 2015 08:11:25 + Oliver wrote: > 2015-02-09 7:52 GMT+00:00 Oliver : > > > regional configuration name not valid <> > > SQL state: 42809 > > > > I've tried es_ES.iso8859-15 and same error. > > If I set encoding to latin9, lc_collate and lc_ctype to 'C', database is > created co

Re: [GENERAL] Change postgresql encoding

2015-02-09 Thread Nicolas Paris
Hello, TRY in psql : update pg_database set encoding = pg_char_to_encoding('your_encoding') where datname = 'your_data_base'; Works for postgres 9.3 Nicolas PARIS 2015-02-09 9:11 GMT+01:00 Oliver : > 2015-02-09 7:54 GMT+00:00 Oliver : > >> 2015-02-08 20:50 GMT+00:00 BladeOfLight16 : >> >>> On

Re: [GENERAL] Partioning with overlapping and non overlapping constraints

2015-02-09 Thread Marc Mamin
>I have two partitioning questions I am hoping somebody can help me with. > >I have a fairly busy metric(ish) table. It gets a few million records per day, >the data is transactional for a while but then settles down and is used for >analytical purposes later. > >When a metric is reported both t

Re: [GENERAL] Change postgresql encoding

2015-02-09 Thread Oliver
2015-02-09 7:54 GMT+00:00 Oliver : > 2015-02-08 20:50 GMT+00:00 BladeOfLight16 : > >> On Sun, Feb 8, 2015 at 2:20 PM, Oliver wrote: >> >>> If I want change postgresql encoding, I have understood that I should >>> reinstall postgresql (I do installation from rpm official binary files for >>> red h

Re: [GENERAL] Change postgresql encoding

2015-02-09 Thread Oliver
2015-02-09 7:52 GMT+00:00 Oliver : > 2015-02-08 20:44 GMT+00:00 Adrian Klaver : > >> On 02/08/2015 11:20 AM, Oliver wrote: >> >>> Hi, >>> I have a new postgresql installation done, it has utf-8 encoding. >>> I have to make a Oracle database migration and it has ISO8859-15 >>> encoding, should I ch