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 karsten.hilb...@gmx.net wrote: You are right in the following aspect: - client sends in NOW at HERE - server knows HERE = UTC+2 And then the

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 karsten.hilb...@gmx.net 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

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 masao.fu...@gmail.com: 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

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 wmo...@potentialtech.com 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

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 nag1...@gmail.com: 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

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 that

Re: [GENERAL] date with month and year

2015-05-22 Thread Alban Hertroys
On 21 May 2015 at 23:42, Karsten Hilbert karsten.hilb...@gmx.net 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

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

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] 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 nag1...@gmail.com wrote:

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 melvin6...@gmail.com 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

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

2015-05-22 Thread Nicklas Av�n
2015-05-22 skrev Albe Laurenz : Nicklas Aveacute;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

[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

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 inner

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 cory.tuc...@gmail.com 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

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-down

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 digi...@gmail.com wrote: Sorry to post this on the list, but I can't find any way of

[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

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

2015-05-22 Thread Tom Lane
Alban Hertroys haram...@gmail.com writes: On 22 May 2015 at 04:46, Bill Moran wmo...@potentialtech.com 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

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 I think this indenting of

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 FILE | grep filter | psql -d DB -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

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 t...@sss.pgh.pa.us wrote: Alban Hertroys haram...@gmail.com writes: On 22 May 2015 at 04:46, Bill Moran wmo...@potentialtech.com wrote: With all that being said, if I were to build a patch, would it be likely to be accepted into core?

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 t...@sss.pgh.pa.us wrote: Bill Moran wmo...@potentialtech.com writes: Tom Lane t...@sss.pgh.pa.us wrote: Other questions you'd have to think about: what is the data type of 0x; what do you do with 0x (too big

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 dennis.jenkins...@gmail.com wrote: On Fri, May 22, 2015 at 10:02 AM, Tom Lane t...@sss.pgh.pa.us wrote: Alban Hertroys haram...@gmail.com writes: On 22 May 2015 at 04:46, Bill Moran wmo...@potentialtech.com wrote: With all that being

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 masao.fu...@gmail.com: 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.

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 t...@sss.pgh.pa.us wrote: Alban Hertroys haram...@gmail.com writes: On 22 May 2015 at 04:46, Bill Moran wmo...@potentialtech.com wrote: With all that being said, if I were to build a patch, would it be likely to be accepted into core? How

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

2015-05-22 Thread Tom Lane
Bill Moran wmo...@potentialtech.com writes: Tom Lane t...@sss.pgh.pa.us 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

[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

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 jfd...@hotmail.com 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