Re: [GENERAL] Strange replication problem - segment restored from archive but still requested from master

2015-05-22 Thread Piotr Gasidło
2015-05-22 2:16 GMT+02:00 Venkata Balaji N : > > It might be yelling about the WAL segment due to the delay in shipping it > from master to slave. > Do you have the restore_command set up in the recovery.conf file ? do you > have any automated job which is shipping WAL archives from master to slave

Re: [GENERAL] Strange replication problem - segment restored from archive but still requested from master

2015-05-22 Thread Piotr Gasidło
2015-05-22 6:55 GMT+02:00 Fujii Masao : > Thanks for the report! This seems to be a bug. > > This problem happens when WAL record is stored in separate two WAL files and > there is no valid latter WAL file in the standby. In your case, the former > file > is 00044C4D0090 and the latter

Re: [GENERAL] Allowing postgresql to accept 0xff syntax for data types that it makes sense for?

2015-05-22 Thread Alban Hertroys
On 22 May 2015 at 04:46, Bill Moran wrote: > I did a litle research and it appears that neither Oracle nor db2 supports > the 0xff syntax ... so not _quite_ as common as it seemed to me. > With all that being said, if I were to build a patch, would it be likely > to be accepted into core? Wouldn

Re: [GENERAL] date with month and year

2015-05-22 Thread Alban Hertroys
On 21 May 2015 at 23:42, Karsten Hilbert wrote: > You are right in the following aspect: > > - client sends in "NOW at HERE" > - server knows HERE = UTC+2 And then the tectonic plate you're on shifts and you're suddenly in UTC+1 or +3 Thankfully, those things don't shift as fast as they sometim

Re: [GENERAL] date with month and year

2015-05-22 Thread Tim Clarke
On 22/05/15 09:40, Alban Hertroys wrote: > On 21 May 2015 at 23:42, Karsten Hilbert wrote: > >> You are right in the following aspect: >> >> - client sends in "NOW at HERE" >> - server knows HERE = UTC+2 > And then the tectonic plate you're on shifts and you're suddenly in UTC+1 or > +3 > > Thank

Re: [GENERAL] Can we simulate Oracle Flashback with pg_export_snapshot()?

2015-05-22 Thread Albe Laurenz
William Dunn wrote: > Just had an idea and could use some feedback. If we start a transaction, > leave it idle, and use > pg_export_snapshot() to get its snapshot_id MVCC will hold all the tuples as > of that transaction's > start and any other transaction can see the state of the database as of

Re: [GENERAL] date with month and year

2015-05-22 Thread Karsten Hilbert
On Fri, May 22, 2015 at 09:46:10AM +0100, Tim Clarke wrote: > On 22/05/15 09:40, Alban Hertroys wrote: > > On 21 May 2015 at 23:42, Karsten Hilbert wrote: > > > >> You are right in the following aspect: > >> > >> - client sends in "NOW at HERE" > >> - server knows HERE = UTC+2 > > And then the te

Re: [GENERAL] Grouping By Similarity (using pg_trgm)?

2015-05-22 Thread Oleg Bartunov
Have you seen http://www.sai.msu.su/~megera/postgres/talks/pgcon-2012.pdf ? On Thu, May 14, 2015 at 9:58 PM, Cory Tucker wrote: > [pg version 9.3 or 9.4] > > Suppose I have a simple table: > > create table data ( > my_value TEXT NOT NULL > ); > CREATE INDEX idx_my_value ON data USING gin(my_v

[GENERAL] Different result depending on order of joins

2015-05-22 Thread Nicklas Avén
Hallo I was a little surprised by this behavior. Is this what is supposed to happen? This query returns what I want: with a as (select generate_series(1,3) a_val) ,b as (select generate_series(1,2) b_val) ,c as (select generate_series(1,1) c_val) select * from a inner join c on a.a_val=c.c

Re: [GENERAL] Different result depending on order of joins

2015-05-22 Thread Albe Laurenz
Nicklas Avén wrote: > I was a little surprised by this behavior. > Is this what is supposed to happen? > > This query returns what I want: > > with > a as (select generate_series(1,3) a_val) > ,b as (select generate_series(1,2) b_val) > ,c as (select generate_series(1,1) c_val) > select * from a

Re: [GENERAL] Different result depending on order of joins

2015-05-22 Thread Nicklas Av�n
2015-05-22 skrev Albe Laurenz : Nicklas Avén wrote: >> I was a little surprised by this behavior. >> Is this what is supposed to happen? >> >> This query returns what I want: >> >> with >> a as (select generate_series(1,3) a_val) >> ,b as (select generate_series(1,2) b_val) >> ,c as (select ge

Re: [GENERAL] Different result depending on order of joins

2015-05-22 Thread Tim Rowe
Sorry to post this on the list, but I can't find any way of unsubscribing -- I've looked in messages, on the community home pages and on a web search, but all I find is a lot of other subscribers with the same problem. How do I unsubscribe from this list, please? On 22 May 2015 at 11:46, Nicklas

Re: [GENERAL] Different result depending on order of joins

2015-05-22 Thread Christofer C. Bell
Tim, You just need to go back to the mailing list page on the PostgreSQL website: * Mailing list page: http://www.postgresql.org/list/ * Management page for subscriptions: http://www.postgresql.org/community/lists/subscribe/ While that URL says "subscribe", on the page itself, there's a drop-dow

Re: [GENERAL] Different result depending on order of joins

2015-05-22 Thread John McKown
Start here: http://www.postgresql.org/community/lists/subscribe/ Change the drop down from SUBSCRIBE to UNSUBSCRIBE and put in the rest of the required information. On Fri, May 22, 2015 at 8:06 AM, Tim Rowe wrote: > Sorry to post this on the list, but I can't find any way of unsubscribing > -- I

[GENERAL] Queries for unused/useless indexes

2015-05-22 Thread Melvin Davidson
Over the years I've wrote many scripts and queries to track the database status. Recently I've had to convince a client who thought it was a good idea to create indexes for every column on every table that it is really a bad idea. To do so, I wrote useless_indexes2.sql, which shows every index that

Re: [GENERAL] Allowing postgresql to accept 0xff syntax for data types that it makes sense for?

2015-05-22 Thread Tom Lane
Alban Hertroys writes: > On 22 May 2015 at 04:46, Bill Moran wrote: >> With all that being said, if I were to build a patch, would it be likely >> to be accepted into core? > Wouldn't you also need to support similar syntax for octal numbers for > the patch to be complete? Or are those already s

Re: [GENERAL] date with month and year

2015-05-22 Thread Gilles Darold
On 22/05/2015 06:09, Adrian Klaver wrote: > On 05/21/2015 09:04 PM, Alvaro Herrera wrote: >> Adrian Klaver wrote: >> >>> SELECT >>> extract ( >>> YEAR >>> FROM >>> school_day ) AS YEAR, >> >>> Reformatting courtesy of pgFormatter(http://sqlformat.darold.net/). >> >> FWIW

Re: [GENERAL] About COPY command (and probably file fdw too)

2015-05-22 Thread Brent Wood
You can already do that, natively in Linux/Mac & by adding some simple tools to try & make Windows useful: cat | grep | psql -d -c "copy ;" between grep, sed, tr, awk you can do almost any in-line filtering or text manipulation you are likely to need. Or a bit of Perl/Python... Brent

Re: [GENERAL] Allowing postgresql to accept 0xff syntax for data types that it makes sense for?

2015-05-22 Thread Dennis Jenkins
On Fri, May 22, 2015 at 10:02 AM, Tom Lane wrote: > Alban Hertroys writes: > > On 22 May 2015 at 04:46, Bill Moran wrote: > >> With all that being said, if I were to build a patch, would it be likely > >> to be accepted into core? > > How feasible would it be to write a network proxy, like pg_b

Re: [GENERAL] Allowing postgresql to accept 0xff syntax for data types that it makes sense for?

2015-05-22 Thread Bill Moran
On Fri, 22 May 2015 11:02:47 -0400 Tom Lane wrote: > Alban Hertroys writes: > > On 22 May 2015 at 04:46, Bill Moran wrote: > >> With all that being said, if I were to build a patch, would it be likely > >> to be accepted into core? > > > Wouldn't you also need to support similar syntax for oct

Re: [GENERAL] Allowing postgresql to accept 0xff syntax for data types that it makes sense for?

2015-05-22 Thread Bill Moran
On Fri, 22 May 2015 11:27:49 -0500 Dennis Jenkins wrote: > On Fri, May 22, 2015 at 10:02 AM, Tom Lane wrote: > > > Alban Hertroys writes: > > > On 22 May 2015 at 04:46, Bill Moran wrote: > > >> With all that being said, if I were to build a patch, would it be likely > > >> to be accepted into

Re: [GENERAL] Strange replication problem - segment restored from archive but still requested from master

2015-05-22 Thread Piotr Gasidło
2015-05-22 6:55 GMT+02:00 Fujii Masao : > > This problem happens when WAL record is stored in separate two WAL files and > there is no valid latter WAL file in the standby. In your case, the former > file > is 00044C4D0090 and the latter is 00044C4D0091. > > In this case, t

Re: [GENERAL] Allowing postgresql to accept 0xff syntax for data types that it makes sense for?

2015-05-22 Thread Tom Lane
Bill Moran writes: > Tom Lane wrote: >> Other questions you'd have to think about: what is the data type of >> 0x; what do you do with 0x (too big >> even for int8). And it'd likely behoove you to check how Microsoft >> answers those questions, if you want to poin

Re: [GENERAL] Allowing postgresql to accept 0xff syntax for data types that it makes sense for?

2015-05-22 Thread Bill Moran
On Fri, 22 May 2015 12:44:40 -0400 Tom Lane wrote: > Bill Moran writes: > > Tom Lane wrote: > >> Other questions you'd have to think about: what is the data type of > >> 0x; what do you do with 0x (too big > >> even for int8). And it'd likely behoove you to chec

[GENERAL] FW: Constraint exclusion in partitions

2015-05-22 Thread Daniel Begin
Sent that on pgsql-novice list but did not get any answers yet. Maybe someone could help me understand here J Hi all, I have split a large table (billions of records) into multiple partitions, hoping the access would be faster. I used an ID to make partitions check (check (id >= 100 A

Re: [GENERAL] FW: Constraint exclusion in partitions

2015-05-22 Thread David G. Johnston
On Fri, May 22, 2015 at 10:21 AM, Daniel Begin wrote: > But how constraint exclusion would react with the following queries … > > b- Select * from parent_table where id between 2345 and 6789; -- > using a range of ids > ​Not sure... ​ These are constants but I'm not sure how smart the plann

Re: [GENERAL] About COPY command (and probably file fdw too)

2015-05-22 Thread Stefan Stefanov
Hi, I agree, pgloader seems to be right. And yes, it’s a matter of complexity and usability estimation. Stefan From: David G. Johnston Sent: Friday, May 22, 2015 12:19 AM To: Nicolas Paris Cc: Stefan Stefanov ; Forums postgresql Subject: Re: [GENERAL] About COPY command (and probably file fdw

Re: [GENERAL] About COPY command (and probably file fdw too)

2015-05-22 Thread Stefan Stefanov
What you suggest is exactly the second option in the first message below but that’s a real lot of overhead. From: Melvin Davidson Sent: Thursday, May 21, 2015 11:48 PM To: Nicolas Paris Cc: Stefan Stefanov ; Forums postgresql Subject: Re: [GENERAL] About COPY command (and probably file fdw too

Re: [GENERAL] Queries for unused/useless indexes

2015-05-22 Thread Venkata Balaji N
On Fri, May 22, 2015 at 11:41 PM, Melvin Davidson wrote: > > Over the years I've wrote many scripts and queries to track the database > status. Recently I've had to convince a client who thought it was a good > idea to create indexes for every column on every table that it is really a > bad idea.

Re: [GENERAL] Queries for unused/useless indexes

2015-05-22 Thread Melvin Davidson
200 is a completely arbitrary value. At the time, I wanted to find indexes that were sufficiently less used than most others in a highly queried system. To find indexes that were never used, just change the value to 0. On Fri, May 22, 2015 at 9:12 PM, Venkata Balaji N wrote: > On Fri, May 22, 20