Re: pg_basebackup + incremental base backups

2019-11-29 Thread Michael Paquier
On Fri, Nov 29, 2019 at 04:57:11PM -0300, Christopher Pereira wrote: > Our stream replication slave server got out of sync so we need to base > backup again. > > In case of big databases, can we do incremental backups with pg_basebackup? I know of two ways to define such backups, one being actual

Re: Counting booleans in GROUP BY sections

2019-11-29 Thread Adrian Klaver
On 11/29/19 11:47 AM, Alexander Farber wrote: Thank you Adrian, but - if I remove GROUP BY mid, then I get the error: ERROR:  42803: column "words_moves.mid" must appear in the GROUP BY clause or be used in an aggregate function LINE 18:         mid,                  ^ LOCATION:  check_un

Re: Counting booleans in GROUP BY sections

2019-11-29 Thread David G. Johnston
On Fri, Nov 29, 2019 at 12:48 PM Alexander Farber < alexander.far...@gmail.com> wrote: > > if I remove GROUP BY mid, then I get the error: > > ERROR: 42803: column "words_moves.mid" must appear in the GROUP BY clause > or be used in an aggregate function > LINE 18: mid, >

Re: How to get column and identifier names in UPPERCASE in postgres?

2019-11-29 Thread Olivier Gautherot
Hi Amine, El mié., 20 de noviembre de 2019 10:11, Amine Tengilimoglu < aminetengilimo...@gmail.com> escribió: > Hi all; > > I want to get the column and other identifier names in UPPERCASE > form rather than a lowercase one without changing application code like > qouting the identifiers.

pg_basebackup + incremental base backups

2019-11-29 Thread Christopher Pereira
Our stream replication slave server got out of sync so we need to base backup again. In case of big databases, can we do incremental backups with pg_basebackup? Is there any alternative? Here was a proposal: https://wiki.postgresql.org/wiki/Incremental_backup

Re: Counting booleans in GROUP BY sections

2019-11-29 Thread Alexander Farber
Thank you Adrian, but - On Fri, Nov 29, 2019 at 6:45 PM Adrian Klaver wrote: > On 11/29/19 8:38 AM, Alexander Farber wrote: > > > > CREATE OR REPLACE FUNCTION words_list_puzzles( > > in_start interval, > > in_end interval > > > > ) RETURNS TABLE ( > >

Re: Rows violating Foreign key constraint exists

2019-11-29 Thread Peter Geoghegan
On Fri, Nov 29, 2019 at 7:23 AM Tom Lane wrote: > The most likely "corruption" explanation is something wrong with the > indexes on the referenced and/or referencing column, causing rows to > not be found when referential actions should have found them. Random > querying of the tables wouldn't ne

Re: Counting booleans in GROUP BY sections

2019-11-29 Thread Adrian Klaver
On 11/29/19 8:38 AM, Alexander Farber wrote: Good evening, I am trying to count the booleans per each GROUP BY section by the following stored function: CREATE OR REPLACE FUNCTION words_list_puzzles(                 in_start interval,                 in_end interval         ) RETURNS TABL

Re: MS Access Frontend

2019-11-29 Thread Adrian Klaver
On 11/29/19 9:23 AM, Jason L. Amerson wrote: I am trying to setup MS Access as a frontend so that it would be easier on my wife and children to interact with PostgreSQL. I looked online for some tutorials but the ones I found are out-date or only pick up after Access is connected to PostgreSQL.

MS Access Frontend

2019-11-29 Thread Jason L. Amerson
I am trying to setup MS Access as a frontend so that it would be easier on my wife and children to interact with PostgreSQL. I looked online for some tutorials but the ones I found are out-date or only pick up after Access is connected to PostgreSQL. I was wondering if someone knew of some update

Counting booleans in GROUP BY sections

2019-11-29 Thread Alexander Farber
Good evening, I am trying to count the booleans per each GROUP BY section by the following stored function: CREATE OR REPLACE FUNCTION words_list_puzzles( in_start interval, in_end interval ) RETURNS TABLE ( out_label text,

Re: Rows violating Foreign key constraint exists

2019-11-29 Thread Tom Lane
Nandakumar M writes: >> It could be that somebody disabled the triggers, but that would have to >> be a superuser. And I hope that people randomly disabling system triggers >> on tables don't have superuser access to your database. > It is unlikely that this happened. So I am assuming corruption

Re: Rows violating Foreign key constraint exists

2019-11-29 Thread Nandakumar M
Hi, > PG already allows a new FK to be created with ADD CONSTRAINT ... NOT > VALID clause which can be validated later using ALTER TABLE ... > VALIDATE CONSTRAINT. > I guess what we are looking for here is the same but for existing FKs. > > i.e Something like > > `ALTER TABLE distributors ALTER CO

Re: Rows violating Foreign key constraint exists

2019-11-29 Thread Nandakumar M
Hi, > Have you verified that the FK is not in the parent table and is just not > some index error/corruption? Yes. > > > > Also, is there any way to make sure the FK checking trigger can never > > be disabled (so that such a case will never arise)? > > Not sure that can happen as it is baked in