Re: How to run a task continuously in the background

2019-07-12 Thread lilu
> 在 2019年7月12日,下午1:06,Dirk Mika 写道: > > > A cron job will only run once a minute, not wake up every second. > > Right, that’s an issue. > > But you could write a PHP program that does a one-second sleep before > checking if there's something to do, and a batch job that runs periodically

Aggregated join vs. aggregate in column?

2019-07-12 Thread Durumdara
Dear Members! I have a query which I extended with an extra calculated column. I need to list the request, and the last date when they scheduled. Example: select request.*, ( select max(s_date) as s_date from schedule where schedule.product_id = request.product_id and sch

Re: Aggregated join vs. aggregate in column?

2019-07-12 Thread David Rowley
On Fri, 12 Jul 2019 at 19:32, Durumdara wrote: > 2.) I may relocate this section as join... > > select > request.*, s.max_s_date > from request > left join > ( > select schedule.product_id, max(s_date) as max_s_date from schedule > where schedule.ok = True > group b

Re: How to run a task continuously in the background

2019-07-12 Thread Tim Clarke
On 12/07/2019 08:08, lilu wrote: > >> 在 2019年7月12日,下午1:06,Dirk Mika > > 写道: >> >> A cron job will only run once a minute, not wake up every second. >> Right, that’s an issue. >> But you could write a PHP program that does a one-second sleep before >> checking if the

help understanding pgbench results

2019-07-12 Thread Luca Ferrari
Hi all, I'm trying to understand some simple benchmarks but I need an hint. =# select version(); version - PostgreSQL 11.1 on x86_64-pc-linux-gn

Issue: Creating Symlink for data directory of postgresql in CentOS7

2019-07-12 Thread Chatterjee, Shibayan
Hi, I'm trying to create a symlink for 'data' directory present in '/var/lib/pgsql/', pointing to different location. After providing exact access permissions and ownership to postgres, I'm still unable to restart postgres after modifications. I've also modified '/var/lib/pgsql/postgresql.conf'

disable and enable trigger all when a foreign keys

2019-07-12 Thread Emanuel Araújo
This is a situation when we needed fill a new store data in a family env. When I run "alter table a disable trigger all;" ... the foreign key "a_id_b_fkey" was disabled to, its ok, but I needed run a load data into tables "a"and "b" and table a exists a tuple that not exists in column id_b -> (ref

Re: disable and enable trigger all when a foreign keys

2019-07-12 Thread Tom Lane
=?UTF-8?Q?Emanuel_Ara=C3=BAjo?= writes: > This is a situation when we needed fill a new store data in a family env. > When I run "alter table a disable trigger all;" ... the foreign key > "a_id_b_fkey" was disabled to, its ok, but I needed run a load data into > tables "a"and "b" and table a exist

Re: disable and enable trigger all when a foreign keys

2019-07-12 Thread Adrian Klaver
On 7/12/19 7:04 AM, Tom Lane wrote: =?UTF-8?Q?Emanuel_Ara=C3=BAjo?= writes: This is a situation when we needed fill a new store data in a family env. When I run "alter table a disable trigger all;" ... the foreign key "a_id_b_fkey" was disabled to, its ok, but I needed run a load data into tabl

Re: Issue: Creating Symlink for data directory of postgresql in CentOS7

2019-07-12 Thread Adrian Klaver
On 7/12/19 3:11 AM, Chatterjee, Shibayan wrote: Hi, I’m trying to create a symlink for ‘data’ directory present in ‘/var/lib/pgsql/’, pointing to different location. Can you show the actual symlink and it containing directory? After providing exact access permissions and ownership to postg

Matview size - space increased on concurrently refresh

2019-07-12 Thread Nicola Contu
Hello, we noticed with a simple matview we have that refreshing it using the concurrently item the space always increases of about 120MB . This only happens if I am reading from that matview and at the same time I am am refreshing it. cmdv3=# SELECT pg_size_pretty(pg_relation_size('public.matview_

Re: Matview size - space increased on concurrently refresh

2019-07-12 Thread Nicola Contu
P.S.: I am on postgres 11.3 Il giorno ven 12 lug 2019 alle ore 16:32 Nicola Contu < nicola.co...@gmail.com> ha scritto: > Hello, > we noticed with a simple matview we have that refreshing it using the > concurrently item the space always increases of about 120MB . > This only happens if I am read

Re: disable and enable trigger all when a foreign keys

2019-07-12 Thread Tom Lane
Adrian Klaver writes: > On 7/12/19 7:04 AM, Tom Lane wrote: >> Well, yeah, DISABLE TRIGGER ALL defeats enforcement of FK constraints. >> That's why you have to be superuser to use it[1]. > The OP is probably trying to understand why the below happens: > alter table a add constraint a_id_b_fkey f

Re: Issue: Creating Symlink for data directory of postgresql in CentOS7

2019-07-12 Thread Laurenz Albe
On Fri, 2019-07-12 at 10:11 +, Chatterjee, Shibayan wrote: > I’m trying to create a symlink for ‘data’ directory present in > ‘/var/lib/pgsql/’, pointing to different location. > After providing exact access permissions and ownership to postgres, I’m still > unable to restart postgres after m

Re: Postgresql and VBA - Connection Timeout

2019-07-12 Thread Wayne Mell
Thank you Adrian, The link you sent had an answer that worked. I had to edit the psqlodbc35w.dll file and change SET statement_timeout = %d to SET statement_timeout = 0 . Somewhere in the thread, Hiroshi Inoue mentioned that a SQL_QUERY_TIMEOUT statement was built into the driver starting wi

FATAL: invalid page in block 0 of relation global/1262

2019-07-12 Thread Ibrahim Edib Kokdemir
Hi, I upgraded my cluster from 9.6 to 11 with pg_upgrade hardlink parameter two days ago. Since then it has been working great as v11. Today while running heavy update queries on it, I got the "FATAL: invalid page in block 0 of relation global/1262" message and server crushed. Hard reset and tryi

Re: FATAL: invalid page in block 0 of relation global/1262

2019-07-12 Thread Luca Ferrari
On Fri, Jul 12, 2019 at 5:22 PM Ibrahim Edib Kokdemir wrote: > > Hi, > I upgraded my cluster from 9.6 to 11 with pg_upgrade hardlink parameter two > days ago. Since then it has been working great as v11. Today while running > heavy update queries on it, I got the "FATAL: invalid page in block

Re: Issue: Creating Symlink for data directory of postgresql in CentOS7

2019-07-12 Thread Luca Ferrari
On Fri, Jul 12, 2019 at 4:47 PM Laurenz Albe wrote: > So there is some "postgresql-check-db-dir" (not part of PostgreSQL) that > complains > that there is nothing in /data/postgresql/data. Is that accurate? > According to this

Compiling table_log for PG 11 / attisdropped

2019-07-12 Thread Ken Tanzer
Hi. I'm trying to update some databases from 9.6 to 11, and they use table_log for tracking changes to tables. I started with the most recent version I could find, a fork labeled version 0.5. [1] This version compiles on both 9.6, and 10, but on 11 it fails with these errors: table_log.c: In f

Re: Compiling table_log for PG 11 / attisdropped

2019-07-12 Thread Adrian Klaver
On 7/12/19 1:19 PM, Ken Tanzer wrote: Hi.  I'm trying to update some databases from 9.6 to 11, and they use table_log for tracking changes to tables. I started with the most recent version I could find, a fork labeled version 0.5.  [1] What OS.version and compiler/version? Some digging fou

Re: Machine learning top of db logs

2019-07-12 Thread Benedict Holland
I have been thinking about how to apply NLP work to logs. The problem is that logs are structured data. It would depend on what you are looking for, what your outcomes are, and how you want to generate it. The other problem is that your problems are going to be very rare events. Rare event detectio

Re: How to extract information from pg_ddl_command type

2019-07-12 Thread Alvaro Herrera
On 2019-Jul-11, Thomas Kellerer wrote: > The function pg_event_trigger_ddl_commands() returns several columns, one of > them being "command" that is of the type "pg_ddl_command". > > The manual[1] describes this column as: > > > A complete representation of the command, in internal format. >

Re: Compiling table_log for PG 11 / attisdropped

2019-07-12 Thread Ken Tanzer
On Fri, Jul 12, 2019 at 1:42 PM Adrian Klaver wrote: > On 7/12/19 1:19 PM, Ken Tanzer wrote: > > Hi. I'm trying to update some databases from 9.6 to 11, and they use > > table_log for tracking changes to tables. > > > > I started with the most recent version I could find, a fork labeled > > vers

Re: Postgresql and VBA - Connection Timeout

2019-07-12 Thread Inoue, Hiroshi
Hi Wayne, On 2019/07/13 0:05, Wayne Mell wrote: Thank you Adrian, The link you sent had an answer that worked. I had to edit the psqlodbc35w.dll file and change SET statement_timeout =  %d to SET statement_timeout =  0 . Somewhere in the thread, Hiroshi Inoue mentioned that a SQL_QUERY_TIM

Testing an extension against multiple versions of Postgresql

2019-07-12 Thread Rhys A.D. Stewart
Greetings All, I have both postgresql versions 10 and 11 installed on my box. I'm working on an extension and just realized that 'make install' installs the extension to the 11 server, but 'make installcheck' runs against the 10 server (I had previously installed the extension there). Running psq

RE: Issue: Creating Symlink for data directory of postgresql in CentOS7

2019-07-12 Thread Chatterjee, Shibayan
Luca, Here's what I modified the $PGDATA to: >>> Environment=PGDATA=/data/postgresql/data -Shibayan -Original Message- From: Luca Ferrari Sent: Friday, July 12, 2019 11:03 AM To: Laurenz Albe Cc: Chatterjee, Shibayan ; pgsql-gene...@postgresql.org Subject: Re: Issue: Creating Symlink

RE: Issue: Creating Symlink for data directory of postgresql in CentOS7

2019-07-12 Thread Chatterjee, Shibayan
Laurenz, For sure there's all the necessary files in '/data/postgresql/data'. The startup process cannot read it, because of sym link. Executing init-db return the below message: # sudo postgresql-setup initdb Data directory is not empty! -Shibayan -Original Message- From: Laurenz

Re: Testing an extension against multiple versions of Postgresql

2019-07-12 Thread Ian Barwick
On 7/13/19 10:55 AM, Rhys A.D. Stewart wrote: Greetings All, I have both postgresql versions 10 and 11 installed on my box. I'm working on an extension and just realized that 'make install' installs the extension to the 11 server, but 'make installcheck' runs against the 10 server (I had prev