Re: Helping planner to chose sequential scan when it improves performance

2023-06-14 Thread Ruslan Zakirov
On Tue, Jun 13, 2023 at 10:28 PM Patrick O'Toole wrote: > Hi all, > > Questions: > >1. In Plan A, what factors are causing the planner to select a >substantially slower plan despite having recent stats about number of rows? > > Estimated overall cost. For Plan A it is ~200k. For plans

Re: Reproducing incorrect order with order by in a subquery

2023-06-14 Thread Ruslan Zakirov
On Wed, Jun 14, 2023 at 3:50 PM Karsten Hilbert wrote: > IOW neither is help to be expected on this list nor can any > testing (on PG) help with anything to be expected on MySQL ? > Don't expect any help on mysql part. As to the question: since the outer query does not have an > ORDER BY it can

Re: date format

2023-06-14 Thread Laurenz Albe
On Wed, 2023-06-14 at 20:02 +0200, Marc Millas wrote: > So, creating a foreign table with varchar type, and then doing the insert as > select with the appropriate format.. clear. > somewhat sad as it was a one step process with the former oracle db we get > rid off. It can be a one-step process,

Re: date format

2023-06-14 Thread Adrian Klaver
On 6/14/23 11:23, Marc Millas wrote: Sort of like?: https://pgloader.readthedocs.io/en/latest/ref/csv.html date format column-name [date format '-MM-DD HH24-MI-SS.US'] In Postgresql, could you write a simple anonymous procedure that reads the file_fdw table records, does t

Re: date format

2023-06-14 Thread Marc Millas
On Wed, Jun 14, 2023 at 8:23 PM Marc Millas wrote: > > > > > On Wed, Jun 14, 2023 at 8:15 PM Ron wrote: > >> On 6/14/23 13:02, Marc Millas wrote: >> >> >> On Wed, Jun 14, 2023 at 7:27 PM David G. Johnston < >> david.g.johns...@gmail.com> wrote: >> >>> On Wed, Jun 14, 2023 at 9:42 AM Marc Millas

Re: date format

2023-06-14 Thread Marc Millas
On Wed, Jun 14, 2023 at 8:15 PM Ron wrote: > On 6/14/23 13:02, Marc Millas wrote: > > > On Wed, Jun 14, 2023 at 7:27 PM David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> On Wed, Jun 14, 2023 at 9:42 AM Marc Millas >> wrote: >> >>> Hi, >>> >>> I would like to load data from a file via

Re: date format

2023-06-14 Thread Ron
On 6/14/23 13:02, Marc Millas wrote: On Wed, Jun 14, 2023 at 7:27 PM David G. Johnston wrote: On Wed, Jun 14, 2023 at 9:42 AM Marc Millas wrote: Hi, I would like to load data from a file via file_fdw or COPY.. its a postgres 14 cluster but.. One da

Re: date format

2023-06-14 Thread Marc Millas
On Wed, Jun 14, 2023 at 7:27 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wed, Jun 14, 2023 at 9:42 AM Marc Millas > wrote: > >> Hi, >> >> I would like to load data from a file via file_fdw or COPY.. its a >> postgres 14 cluster >> >> but.. One date (timestamp) column is written

Re: date format

2023-06-14 Thread David G. Johnston
On Wed, Jun 14, 2023 at 9:42 AM Marc Millas wrote: > Hi, > > I would like to load data from a file via file_fdw or COPY.. its a > postgres 14 cluster > > but.. One date (timestamp) column is written french order and another > column is written english order. Data comes from a state owned entity s

Re: date format

2023-06-14 Thread Michael Nolan
Can you use a CASE statement? The real issue with date conversion is not knowing if a value of 02-03-2023 is mm-dd- or dd-mm-. On Wed, Jun 14, 2023 at 11:42 AM Marc Millas wrote: > > Hi, > > I would like to load data from a file via file_fdw or COPY.. its a postgres > 14 cluster > > but

date format

2023-06-14 Thread Marc Millas
Hi, I would like to load data from a file via file_fdw or COPY.. its a postgres 14 cluster but.. One date (timestamp) column is written french order and another column is written english order. Data comes from a state owned entity so asking for a normalization may take ages. obviously I could lo

Re: Active Active PostgreSQL Solution

2023-06-14 Thread Jan Wieck
On 6/9/23 06:38, Mohsin Kazmi wrote: Hello Everyone, I have been working on PostgreSQL databases for the last three years and I have also migrate databases from Oracle to PostgreSQL as well. I configured PostgreSQL for logical replication as well. Now in order to deploy PostgreSQL in our pro

Re: Reproducing incorrect order with order by in a subquery

2023-06-14 Thread Karsten Hilbert
Am Wed, Jun 14, 2023 at 01:03:06PM +0300 schrieb Ruslan Zakirov: > > This is a too complex query to build a test on. Tried simpler scenarios > > and failed. > > > > First of all I want to apologize. We work with multiple RDBMS systems. This > particular user is using mysql. ... > Anyway, yesterday

Re: Reproducing incorrect order with order by in a subquery

2023-06-14 Thread Ron
On 6/14/23 05:03, Ruslan Zakirov wrote: [snip] Anyway, yesterday I tried my simplified case on Pg latest, Pg 11 and on mysql latest. Had no luck. Either my test case is too simple or I can not find the correct distribution of data between two tables. This is when you need a prod copy... -- Bo

Re: Reproducing incorrect order with order by in a subquery

2023-06-14 Thread Ruslan Zakirov
On Tue, Jun 13, 2023 at 8:55 PM Ruslan Zakirov wrote: > On Tue, Jun 13, 2023 at 6:06 PM Tom Lane wrote: > >> Ruslan Zakirov writes: >> > I know how to fix the problem and I know that ORDER BY should be in the >> > outermost select. >> >> > However, I want to write a test case that shows that th

Re: SOC II Type 2 report.

2023-06-14 Thread raf
On Tue, Jun 13, 2023 at 07:54:21AM -0700, Christophe Pettus wrote: > Hi, > > > On Jun 12, 2023, at 11:57, Raj Kiran wrote: > > Prokopto is completing our annual vendor review process. Please share your > > most recent SOC II Type 2 report. > > The PostgreSQL project isn't SOC2 certified, and