Deadlock between concurrent index builds on different tables

2017-12-22 Thread Jeremy Finzel
I am attempting to build several indexes in parallel, guaranteeing that I never build one on the same table twice. I understand I can't build two on the same table at once or I will get a deadlock. However, I am also getting a deadlock when doing several in parallel on different tables. Here is

Re: Does postgresq database supports reading data from the same table from many observable simultanousely?

2017-12-22 Thread Joshua D. Drake
On 12/22/2017 11:20 AM, hmidi slim wrote: But is it possible to make simultanoues select queries from the same connection? Yes but it will happen serially. JD -- Command Prompt, Inc. || http://the.postgres.company/ || @cmdpromptinc PostgreSQL centered full stack support, consulting and deve

Problem with pgq3 packages missing pgq_node

2017-12-22 Thread Jeremy Finzel
Posting here because it seems the pgsql-pkg-debian list is not very responsive. This recent package appears to be broken for pgq3, used for Skytools replication: https://www.postgresql.org/message-id/E1eR2Lv-0003h7-FC@ atalia.postgresql.org There is no pgq_node.control file (postgresql-9.6-pgq3),

Re: Array of foreign key

2017-12-22 Thread Andreas Kretschmer
>Please DO NOT use EMUMs. That is old. They are hard to maintain. I also >know from experience that MySql does not check >integrity of enums. It's possible you can have data in a MySql table >column >that is not valid for current enum constraint on that column. >EG: When porting, the enum for a co

Re: Array of foreign key

2017-12-22 Thread Melvin Davidson
On Fri, Dec 22, 2017 at 3:40 PM, Thomas Poty wrote: > Actually, We are migrating from Mysql to postgresql and we have to replace > sets of Mysql. The migration we will be done in 2 steps: First, in a like > for like way. Second step will be using postgresql powerfulness > > I think the most like

Re: Array of foreign key

2017-12-22 Thread Thomas Poty
Actually, We are migrating from Mysql to postgresql and we have to replace sets of Mysql. The migration we will be done in 2 steps: First, in a like for like way. Second step will be using postgresql powerfulness I think the most like for like way to migrate sets is using enum array. Thank you A

Re: Does postgresq database supports reading data from the same table from many observable simultanousely?

2017-12-22 Thread James Keener
Connections are synchronous. You can have multiple connections to the database at a time. Jim On December 22, 2017 2:20:03 PM EST, hmidi slim wrote: >But is it possible to make simultanoues select queries from the same >connection? > >2017-12-22 20:00 GMT+01:00 Andreas Kretschmer >: > >> On 22

Re: Array of foreign key

2017-12-22 Thread Andreas Kretschmer
On 22 December 2017 20:02:43 CET, Thomas Poty wrote: >Hello all, > >I use postgresql 9.5 and I am looking for way to have a column which is >an >array of a foreign key. If what I read is correct it is currently not >possible... Have you any idea how to implement this feature in a safe >way Normal

Re: Does postgresq database supports reading data from the same table from many observable simultanousely?

2017-12-22 Thread hmidi slim
But is it possible to make simultanoues select queries from the same connection? 2017-12-22 20:00 GMT+01:00 Andreas Kretschmer : > On 22 December 2017 19:53:03 CET, hmidi slim > wrote: > >Hi, > >I don't know if is it the suitable place to ask my question but I want > >to > >know if a table in a

Re: Does postgresq database supports reading data from the same table from many observable simultanousely?

2017-12-22 Thread Chris Ellis
Hi On 22 Dec 2017 6:53 pm, "hmidi slim" wrote: > Hi, > I don't know if is it the suitable place to ask my question but I want to > know if a table in a postgres database enable multiple reading actions for > mayn rxjs observbles or not. > I create two observables that need to access the same tab

Array of foreign key

2017-12-22 Thread Thomas Poty
Hello all, I use postgresql 9.5 and I am looking for way to have a column which is an array of a foreign key. If what I read is correct it is currently not possible... Have you any idea how to implement this feature in a safe way (foreign key constraints) ? I don't have another idea to have a enum

Re: Does postgresq database supports reading data from the same table from many observable simultanousely?

2017-12-22 Thread Andreas Kretschmer
On 22 December 2017 19:53:03 CET, hmidi slim wrote: >Hi, >I don't know if is it the suitable place to ask my question but I want >to >know if a table in a postgres database enable multiple reading actions >for >mayn rxjs observbles or not. Not sure if i understand your question. But for sure PG i

Does postgresq database supports reading data from the same table from many observable simultanousely?

2017-12-22 Thread hmidi slim
Hi, I don't know if is it the suitable place to ask my question but I want to know if a table in a postgres database enable multiple reading actions for mayn rxjs observbles or not. I create two observables that need to access the same table simultanously to get data, but I found that only one of t

Re: Stand by server (9.6.6) with corrupt file

2017-12-22 Thread Edson Carlos Ericksson Richter
No, it is a normal table. *Edson Carlos Ericksson Richter* /SimKorp Ltda/ Fone: (51) 3366-7964 Embedded Image /"A mente que se abre a uma nova ideia jamais voltará ao seu tamanho original"/ - Albert Einstein Em 22/12/2017 11:42, Stephen Frost escreveu: Greetings, * Edson Carlos Ericksson

Re: AWS Aurora and PG 10

2017-12-22 Thread Jernigan, Kevin
On 12/19/17, 11:16 AM, "Rakesh Kumar" wrote: Has AWS Aurora started supporting PG 10. Their website still talks about 9.6. Thanks We are working to add support for PostgreSQL 10 for both Aurora PostgreSQL and RDS for PostgreSQL. We don’t have a specific date to communicate;

Re: Intersection or zero-column queries

2017-12-22 Thread Tom Lane
I wrote: > "David G. Johnston" writes: >> How about just erroring out? > Hm, yeah, inserting a FEATURE_NOT_SUPPORTED error might be an > appropriate amount of effort. When I looked into this more closely, it turns out that in v10/HEAD it takes less code to fix it than to throw an error ;-). So

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread rihad
Here's the prompt response I got from the maintainer of FreeBSD package, girgen@ Forwarded Message Subject: Re: pg_upgrading to 10.1 breaks some indices maybe due to changing providers for ICU Date: Fri, 22 Dec 2017 17:44:41 +0100 From: Palle Girgensohn To: rihad

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread rihad
Here's the prompt response I got from the maintainer of FreeBSD package, girgen@ Forwarded Message Subject: Re: pg_upgrading to 10.1 breaks some indices maybe due to changing providers for ICU Date: Fri, 22 Dec 2017 17:44:41 +0100 From: Palle Girgensohn To: rihad

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread Peter Geoghegan
On Fri, Dec 22, 2017 at 4:16 PM, rihad wrote: > You mean they would have to bring back ICU support as an option? Ok, I'll > try to report the problem. The FreeBSD package previously contained a hacked-in ICU library, meaning that the version of Postgres shipped with FreeBSD was technically a fork

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread rihad
On 12/22/2017 08:07 PM, Peter Geoghegan wrote: Please report this as a bug to the freebsd package maintainer. You mean they would have to bring back ICU support as an option? Ok, I'll try to report the problem.

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread Peter Geoghegan
Please report this as a bug to the freebsd package maintainer. -- Peter Geoghegan (Sent from my phone)

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread rihad
On 12/22/2017 07:43 PM, Peter Geoghegan wrote: I have no idea. Maybe something to do with not actually using the same collation provider? The freebsd package contains modifications to make icu work, or at least did. Possibly, you just stopped using the same collation provider, without even re

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread Peter Geoghegan
I have no idea. Maybe something to do with not actually using the same collation provider? The freebsd package contains modifications to make icu work, or at least did. Possibly, you just stopped using the same collation provider, without even realizing it, because they switched over to a new prov

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread rihad
I wonder why the errors don't show up under 9.6.6 and only started appearing after the pg_upgrade to 10.1? Both severs naturally used the same OS environment.

Re: Intersection or zero-column queries

2017-12-22 Thread Tom Lane
Ken Tanzer writes: > I noticed I get this behavior in 9.6, but in 9.2 an empty select results in > a syntax error. Which just got me curious what caused the change, if it > was deliberate, and if one or the other is more proper behavior. Yes, it was an intentional change, see https://git.postgre

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread rihad
On 12/22/2017 07:01 PM, rihad wrote: [snip] foo=# select bt_index_check('index_users_on_email_and_type'); ERROR:  item order invariant violated for index "index_users_on_email_and_type" DETAIL:  Lower index tid=(3,25) (points to index tid=(26,1)) higher index tid=(3,26) (points to index tid=(27

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread rihad
On 12/22/2017 05:32 PM, Peter Geoghegan wrote: On Fri, Dec 22, 2017 at 11:56 AM, rihad wrote: I forgot to mention the real problem: the mentioned unique constraint didn't work and allowed duplicate rows to get inserted into the table until the duplicates were manually removed the the index was

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread Laurenz Albe
rihad wrote: > On 12/22/2017 05:09 PM, Laurenz Albe wrote: > > rihad wrote: > > > Hi there, this is a reproducible error. We recently pg_upgraded our > > > production database to 10.1 from 9.6.6. The upgrade runs fine with the > > > suggestion to analyze all data. > > > > [...] > > > > > Trying t

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread rihad
On 12/22/2017 05:09 PM, Laurenz Albe wrote: rihad wrote: Hi there, this is a reproducible error. We recently pg_upgraded our production database to 10.1 from 9.6.6. The upgrade runs fine with the suggestion to analyze all data. [...] Trying to find data using the specified indices fails to fi

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread rihad
On 12/22/2017 05:09 PM, Magnus Hagander wrote: What platform are you on FreeBSD 10.3-RELEASE-p26 amd64 , how was PostgreSQL installed pkg install. Additionally, 10.1 needed for pg_upgrade to run was installed using portmaster -m PREFIX=/10.1, because FreeBSD doesn't allow more than one maj

Why standby restores some WALs many times from archive?

2017-12-22 Thread Victor
Hi, I have postgres 9.4 standby with archive-based replication (via restore_command). PostgreSQL 9.4.12 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit One day I noticed strange behavior in postgres logs: the same WAL has been restored many times: "restored log fi

Re: Stand by server (9.6.6) with corrupt file

2017-12-22 Thread Stephen Frost
Greetings, * Edson Carlos Ericksson Richter (rich...@simkorp.com.br) wrote: > I was testing our database backup system (based on pgBarman), and > discovered that one base file is corrupt in our standby database > server. The file is OK in master server, but has 0 bytes in size in > standby server.

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread Peter Geoghegan
On Fri, Dec 22, 2017 at 11:56 AM, rihad wrote: > I forgot to mention the real problem: the mentioned unique constraint didn't > work and allowed duplicate rows to get inserted into the table until the > duplicates were manually removed the the index was rebuilt. You should run amcheck functions o

Stand by server (9.6.6) with corrupt file

2017-12-22 Thread Edson Carlos Ericksson Richter
Environment: PostgreSQL 9.6.6 installed from yum repository. Oracle Linux 7 EL x64. Dell servers with Raid 5 (hw). I was testing our database backup system (based on pgBarman), and discovered that one base file is corrupt in our standby database server. The file is OK in master server, but ha

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread Laurenz Albe
rihad wrote: > Hi there, this is a reproducible error. We recently pg_upgraded our > production database to 10.1 from 9.6.6. The upgrade runs fine with the > suggestion to analyze all data. [...] > Trying to find data using the specified indices fails to find matching rows: [...] > reindexing

Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread Magnus Hagander
On Fri, Dec 22, 2017 at 12:53 PM, rihad wrote: > Hi there, this is a reproducible error. We recently pg_upgraded our > production database to 10.1 from 9.6.6. The upgrade runs fine with the > suggestion to analyze all data. > > [rihad@postgres-10-test]$ cat analyze_new_cluster.sh > #!/bin/sh > >

pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread rihad
I forgot to mention the real problem: the mentioned unique constraint didn't work and allowed duplicate rows to get inserted into the table until the duplicates were manually removed the the index was rebuilt.

pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices

2017-12-22 Thread rihad
Hi there, this is a reproducible error. We recently pg_upgraded our production database to 10.1 from 9.6.6. The upgrade runs fine with the suggestion to analyze all data. [rihad@postgres-10-test]$ cat analyze_new_cluster.sh #!/bin/sh echo 'This script will generate minimal optimizer statistics

Character with byte sequence error

2017-12-22 Thread Ertan Küçükoğlu
Hello, I am using following: Windows PC (WIN1254 Turkish locale): PostgreSQL 10.1, compiled by Visual C++ build 1800, 64-bit (initdb complete with UTF8 Turkish locale) Raspberry Pi 3(us_US.UTF8 locale): PostgreSQL 9.6.6 on armv8l-unknown-linux-gnueabihf, compiled by gcc (Raspbian 6.3.0-18+rpi1) 6.

Re: Deadlock with one table - PostgreSQL is doing it right

2017-12-22 Thread Hans Schou
2017-12-21 21:50 GMT+01:00 Rakesh Kumar : > whenever SQLERROR EXIT ROLLBACK > Thanks. You are absolutely right. After starting with: WHENEVER SQLERROR EXIT ROLLBACK the process getting the deadlock will exit to command prompt (with %ERRORLEVEL% = 0). So what actually found out was that Oracle