Extract dates of a given day

2018-04-06 Thread hmidi slim
Hi, I have a table availability: id (integer), product varchar(255), period (daterange) I want to extract dates from a given period matching a given day. E.g: for the period from *01/04/2018 - 30/04/2018* and for *day = Monday* I want to get *02/04/201809/04/201816/04/201823/04/201830/04/2018*

Re: Extract dates of a given day

2018-04-06 Thread mariusz
On Fri, 2018-04-06 at 11:32 +0100, hmidi slim wrote: > Hi, > > I have a table availability: id (integer), product varchar(255), > period (daterange) > > I want to extract dates from a given period matching a given day. > > E.g: for the period from 01/04/2018 - 30/04/2018 and for day = Monday >

Re: Extract dates of a given day

2018-04-06 Thread rob stone
Hello, On Fri, 2018-04-06 at 11:32 +0100, hmidi slim wrote: > Hi, > I have a table availability: id (integer), product varchar(255), > period (daterange) > I want to extract dates from a given period matching a given day. > E.g: for the period from 01/04/2018 - 30/04/2018 and for day = > Monday

Re: ERROR: found multixact from before relminmxid

2018-04-06 Thread Tomas Vondra
On 04/06/2018 02:09 AM, Alexandre Arruda wrote: > Hi, > > Some time ago, I had this errors frequently showed in logs after some > autovacuum in some tables(pg 9.6). VACUUM FULL or CLUSTER in this tables > show the same and not complete the tasks (showed by some table bloat > select). > Then, I d

RE: LDAP Bind Password

2018-04-06 Thread Kumar, Virendra
Thank you Peter! I figured that out. Regards, Virendra -Original Message- From: Peter Eisentraut [mailto:peter.eisentr...@2ndquadrant.com] Sent: Wednesday, April 04, 2018 8:41 PM To: Kumar, Virendra; pgsql-gene...@postgresql.org Subject: Re: LDAP Bind Password On 4/3/18 16:12, Kumar, Vi

Re: decompose big queries

2018-04-06 Thread Edson Carlos Ericksson Richter
Em 05/04/2018 19:39, hmidi slim escreveu: Hi, I want to know what are the best practice to use in order to decompose a big query which contains so many joins.Is it recommended to use stored procedures ? or is there any other solution? I don't know if there are best practices (each scenario

Re: decompose big queries

2018-04-06 Thread pinker
Edson Carlos Ericksson Richter wrote > I don't know if there are best practices (each scenario requires its own > solution), but for plain complex SELECT queries, I do use "WITH" > queries... They work really well. Be cautious with CTE's. They weren't meant to be an alternative to subqueries and

Re: decompose big queries

2018-04-06 Thread Melvin Davidson
On Fri, Apr 6, 2018 at 9:35 AM, pinker wrote: > Edson Carlos Ericksson Richter wrote > > I don't know if there are best practices (each scenario requires its own > > solution), but for plain complex SELECT queries, I do use "WITH" > > queries... They work really well. > > Be cautious with CTE's.

Re: decompose big queries

2018-04-06 Thread Steven Hirsch
On Fri, 6 Apr 2018, pinker wrote: Edson Carlos Ericksson Richter wrote I don't know if there are best practices (each scenario requires its own solution), but for plain complex SELECT queries, I do use "WITH" queries... They work really well. Be cautious with CTE's. They weren't meant to be a

Re: ERROR: found multixact from before relminmxid

2018-04-06 Thread Alexandre Arruda
2018-04-06 9:39 GMT-03:00 Tomas Vondra : > > > On 04/06/2018 02:09 AM, Alexandre Arruda wrote: > > Hi, > > > > Some time ago, I had this errors frequently showed in logs after some > > autovacuum in some tables(pg 9.6). VACUUM FULL or CLUSTER in this tables > > show the same and not complete the t

dealing with lock

2018-04-06 Thread Thomas Poty
Hello All, Here is a bit of context : we are migrating from MySQL to PostgreSQL and we have about 1000 tables. Some tables are quite small but some others are very large. The service provided to our clients relies on a high avaiability with a minimum down time due to any legal deadlines. So, lets

Re: dealing with lock

2018-04-06 Thread Laurenz Albe
On Fri, 2018-04-06 at 16:58 +0200, Thomas Poty wrote: > Here is a bit of context : we are migrating from MySQL to PostgreSQL and we > have about 1000 tables. > Some tables are quite small but some others are very large. The service > provided to our clients > relies on a high avaiability with a m

Re: ERROR: found multixact from before relminmxid

2018-04-06 Thread Tomas Vondra
On 04/06/2018 04:29 PM, Alexandre Arruda wrote: > 2018-04-06 9:39 GMT-03:00 Tomas Vondra >: > > > > On 04/06/2018 02:09 AM, Alexandre Arruda wrote: > > Hi, > > > > Some time ago, I had this errors frequently showed in logs after some >

Re: dealing with lock

2018-04-06 Thread Thomas Poty
Thank you Laurenz ! We will certainly have to change our release management. Is there a way to identify the list of statements that have to rewrite the table. If I am right, at least these statements need to do this : - create a unique index - add a column with a default value Regards, Thoma

FDW with DB2

2018-04-06 Thread Ravi Krishna
Has anyone used PG with DB2(Linux) ?

Re: FDW with DB2

2018-04-06 Thread Joshua D. Drake
On 04/06/2018 01:01 PM, Ravi Krishna wrote: Has anyone used PG with DB2(Linux) ? Looks like the way you go about it is with the ODBC FDW. JD -- Command Prompt, Inc. || http://the.postgres.company/ || @cmdpromptinc *** A fault and talent of mine is to tell it exactly how it is. *** PostgreS

Re: FDW with DB2

2018-04-06 Thread Ravi Krishna
On Fri, Apr 6, 2018 at 4:09 PM, Joshua D. Drake wrote: > On 04/06/2018 01:01 PM, Ravi Krishna wrote: > > Has anyone used PG with DB2(Linux) ? > > > Looks like the way you go about it is with the ODBC FDW. > ​https://wiki.postgresql.org/wiki/Foreign_data_wrappers There are two ODBC drivers. One

Re: FDW with DB2

2018-04-06 Thread Steven Hirsch
On Fri, 6 Apr 2018, Ravi Krishna wrote: There are two ODBC drivers. One does not compile and the other one piggy backs on a community effort for Cartodb. Looks like Db2 is used by very few and even less want a divorce from DB2 -> no motivation to write native FDW like that for Oracle :-) the

Re: dealing with lock

2018-04-06 Thread Adrian Klaver
On 04/06/2018 12:09 PM, Thomas Poty wrote: Thank you Laurenz ! We will certainly have to change our release management. Is there a way to identify the list of statements that have to rewrite the table. https://www.postgresql.org/docs/10/static/sql-altertable.html Notes "Adding a column wi

Re: FDW with DB2

2018-04-06 Thread Ravi Krishna
> > > > the CartoDB ODBC driver works quite well. I've used it to move a large > amount of data from DB2 and Netezza databases. > ​Hello Steven Will it be OK if I or my team reach out to you for any guidance/help. ​

Re: FDW with DB2

2018-04-06 Thread Steven Hirsch
On Fri, 6 Apr 2018, Ravi Krishna wrote: the CartoDB ODBC driver works quite well.  I've used it to move a large amount of data from DB2 and Netezza databases.   ​Hello Steven Will it be OK if I or my team reach out to you for any guidance/help. To the extent that questions on

Re: FDW with DB2

2018-04-06 Thread Ravi Krishna
Yes of course I respect your time. regards. Please do not contact me personally, as I'm too busy to provide technical > support on a private basis. Thanks for your understanding! >

Re: dealing with lock

2018-04-06 Thread Thomas Kellerer
Adrian Klaver schrieb am 07.04.2018 um 00:02: Is there a way to identify the list of statements that have to rewrite the table. https://www.postgresql.org/docs/10/static/sql-altertable.html Notes "Adding a column with a DEFAULT clause or changing the type of an existing column will require t