Re: Is this a buggy behavior?

2024-03-24 Thread Andreas Kretschmer
Am 24.03.24 um 16:41 schrieb Thiemo Kellner: Am 24.03.2024 um 16:36 schrieb Andreas Kretschmer: the null-able constraint addition to a column is pointless because by default all columns are nullable. definition as a primary key adds the not null constraint. While this is certainly true

Re: Is this a buggy behavior?

2024-03-24 Thread Andreas Kretschmer
n creating the primary key? Not even in some kind of intermediary catalogue? the null-able constraint addition to a column is pointless because by default all columns are nullable. definition as a primary key adds the not null constraint. Andreas -- Andreas Kretschmer CYBERTEC PostgreSQ

Re: PostgreSQL Read-only mode usage

2024-02-28 Thread Andreas Kretschmer
Am 28.02.24 um 13:34 schrieb Jason Long: Hello, What is the use of a database in read-only mode? a standby-database will also be in read-only mode. Regards, Andreas -- Andreas Kretschmer CYBERTEC PostgreSQL Services and Support

Re: Deleting duplicate rows using ctid ?

2024-02-06 Thread Andreas Kretschmer
postgres=# select * from dogs;  dog --  dog1  dog2  dog3 (3 rows) postgres=# Regards, Andreas -- Andreas Kretschmer CYBERTEC PostgreSQL Services and Support

Re: Why scan all columns when we select distinct c1?

2024-01-14 Thread Andreas Kretschmer
=0.15..63.93 rows=200 width=4)    Output: c1    ->  Index Only Scan using idx1 on public.t1  (cost=0.15..61.10 rows=1130 width=4) Output: c1 (4 rows) now we scan only the index and not the heap. Regards, Andreas -- Andreas Kretschmer CYBERTEC PostgreSQL Services and Support

Re: Query runtime differences- trying to understand why.

2023-11-29 Thread Andreas Kretschmer
took 31.241 milliseconds.  Note the query has hints in it what database are you using? PostgreSQL doesn't hav hints... Regards, Andreas -- Andreas Kretschmer - currently still (garden leave) Technical Account Manager (TAM) www.enterprisedb.com

Re: replication primary writting infinite number of WAL files

2023-11-24 Thread Andreas Kretschmer
Am 24.11.23 um 13:52 schrieb Les: Andreas Kretschmer wrote (2023. nov. 24., P, 13:22): Am 24.11.23 um 12:39 schrieb Les: > > Hello, > please check the database log, a VACUUM can also lead to massive wal generation. Can you find other related

Re: replication primary writting infinite number of WAL files

2023-11-24 Thread Andreas Kretschmer
find other related messages? by the way, the picture is hard to read, please post text instead of pictures. Regards, Andreas -- Andreas Kretschmer - currently still (garden leave) Technical Account Manager (TAM) www.enterprisedb.com

Re: IPV6 issue

2023-11-23 Thread Andreas Kretschmer
/21-2/installing/system-recommendations-and-requirements/linux-servers/disable-ipv6-networking-on-linux-servers.html Andreas -- Andreas Kretschmer - currently still (garden leave) Technical Account Manager (TAM) www.enterprisedb.com

Re: Configuration knobs & dials to speed up query optimization

2023-11-23 Thread Andreas Kretschmer
. Andreas -- Andreas Kretschmer - currently still (garden leave) Technical Account Manager (TAM) www.enterprisedb.com

Re: strange behavior of pg_hba.conf file

2023-11-22 Thread Andreas Kretschmer
> > Regards. > -- Adrian Klaver adrian.kla...@aklaver.com -- Andreas Kretschmer - currently still (garden leave) Technical Account Manager (TAM) www.enterprisedb.com

Re: strange behavior of pg_hba.conf file

2023-11-22 Thread Andreas Kretschmer
use it? Disable it or add an entry for it. Regards, Andreas -- Andreas Kretschmer - currently still (garden leave) Technical Account Manager (TAM) www.enterprisedb.com

Re: PITR

2023-11-22 Thread Andreas Kretschmer
://blog.hagander.net/locating-the-recovery-point-just-before-a-dropped-table-230/ Andreas -- Andreas Kretschmer - currently still (garden leave) Technical Account Manager (TAM) www.enterprisedb.com

Re: Postgresql went crazy and flooded all the SSD

2023-11-06 Thread Andreas Kretschmer
On 6 November 2023 12:11:31 CET, Gabriel Dodan wrote: >Not sure exactly what happened but Postgresql flooded all the available SSD >space and obviously crashed. It has written a lot of data in the pg_wal >folder. Most likely it was caused by replication. The postgresql instance >that crashed

Re: REINDEX in tables

2023-10-25 Thread Andreas Kretschmer
Am 25.10.23 um 14:11 schrieb Laurenz Albe: On Wed, 2023-10-25 at 11:59 +0200, Andreas Kretschmer wrote: Am 25.10.23 um 11:57 schrieb Matthias Apitz: El día miércoles, octubre 25, 2023 a las 11:33:11 +0200, Andreas Kretschmer escribió: Am 25.10.23 um 11:24 schrieb Matthias Apitz: We have

Re: REINDEX in tables

2023-10-25 Thread Andreas Kretschmer
Am 25.10.23 um 11:57 schrieb Matthias Apitz: El día miércoles, octubre 25, 2023 a las 11:33:11 +0200, Andreas Kretschmer escribió: Am 25.10.23 um 11:24 schrieb Matthias Apitz: We have a client who run REINDEX in certain tables of the database of our application (on Linux with PostgreSQL

Re: REINDEX in tables

2023-10-25 Thread Andreas Kretschmer
400 tables. The client is now concerned about the issue that the number of rows in some of the above tables has increased. Is this possible? In principle, there is nothing wrong with doing this in a maintenance window, for example. Regards, Andreas -- Andreas Kretschmer - currently still

Re: why generated columsn cannot be used in COPY TO?

2023-10-06 Thread Andreas Kretschmer
;-) Not sure how convincing that reasoning is, but it was at least thought about. I do agree with it as far as the default column list goes, but maybe we could allow explicit selection of these columns in COPY TO. sounds okay Andreas -- Andreas Kretschmer - currently still (garden leave) Technical

Re: why generated columsn cannot be used in COPY TO?

2023-10-06 Thread Andreas Kretschmer
row) test=*# commit; COMMIT test=# copy test to stdout; 1    06-OCT-23 14:18:28.742152 test=*# copy test to stdout; 1    06-OCT-23 14:18:28.742152 test=*# copy (select * from test) to stdout; 1    06-OCT-23 14:18:28.742152    10 test=*# Andreas -- Andreas Kretschmer - currently still (garden leave)

Re: How to investigate deadlocks

2023-10-03 Thread Andreas Kretschmer
details. 2023-09-30 16:50:50.951 CEST [18117] CONTEXT: while locking tuple (38,57) in relation "d03geb" 2023-09-30 16:50:50.951 CEST [18117] STATEMENT: fetch hc_d03geb have you checked the server log? See server log for query details. Regards, Andreas -- Andreas Kretschmer Technic

Re: How to investigate deadlocks

2023-10-03 Thread Andreas Kretschmer
? please also check https://www.cybertec-postgresql.com/en/postgresql-understanding-deadlocks/ Andreas -- Andreas Kretschmer Technical Account Manager (TAM) www.enterprisedb.com

Re: Operating of synchronous master when no standby is available

2023-10-02 Thread Andreas Kretschmer
are online, but primary no waits confirmation from replica if replica is not connected? yes, with 3 or more sync. standbys. Andreas -- Andreas Kretschmer Technical Account Manager (TAM) www.enterprisedb.com

Re: Will PostgreSQL 16 supports native transparent data encryption ?

2023-08-21 Thread Andreas Kretschmer
On 22 August 2023 06:52:10 CEST, Ron wrote: >On 8/21/23 18:49, Bruce Momjian wrote: >> On Mon, Aug 21, 2023 at 07:02:46PM +0300, Mostafa Fathy wrote: >>> Hi there, >>> >>> It is mentioned here https://www.postgresql.org/about/press/faq/#:~:text= >>>

Re: Fatal Error : Invalid Memory alloc request size 1236252631

2023-08-14 Thread Andreas Kretschmer
On 14 August 2023 11:59:26 CEST, Sai Teja wrote: >Hi Team, > >We are trying to fetch the one row of data (bytea data) for one table in >But getting the error stating that "Invalid Memory alloc request size >1236252631" > >The row which we were trying to fetch have one bytea column which is

Re: PostgreSQL Server Hang​

2023-06-21 Thread Andreas Kretschmer
On 22 June 2023 07:09:26 CEST, KK CHN wrote: >*Description of System: * >1. We are running a Postgres Server (version 12, on CentOS 6) for an >emergency call attending and vehicle tracking system fitted with mobile >devices for vehicles with navigation apps for emergency service. > >2.

Re: Active Active PostgreSQL Solution

2023-06-09 Thread Andreas Kretschmer
On 9 June 2023 12:38:40 CEST, 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

Re: Would PostgreSQL 16 native transparent data encryption support database level encryption?

2023-05-18 Thread Andreas Kretschmer
It is in epas15, but for the whole cluster. Different keys for each database is not possible, how should it works for instance the wal - stream? On 18 May 2023 00:35:39 CEST, Tony Xu wrote: >Hi There, > >The FAQ (copied below) mentioned that native transparent data encryption >might be included

Re: Additive backup and restore?

2023-05-08 Thread Andreas Kretschmer
Consider table partitioning. You can detach, save and delete partitions, and you can restore and attach partitions. On 8 May 2023 12:24:06 CEST, Age Apache wrote: >I am designing a database for a web application. In the near future I will >require past data for Audit, Security and Analysis

Re: pg_wal directory max size

2022-12-21 Thread Andreas Kretschmer
On 22 December 2022 04:00:57 CET, Yi Sun wrote: >Hello guys, > >We are planning the server disk space, pg_wal directory max size is wal >file size*wal_keep_segments? or is it also decided by other parameters >please? We tried to search for this, but could not find the answer > >For example our

Re: pg_wal directory max size

2022-12-21 Thread Andreas Kretschmer
On 22 December 2022 04:00:57 CET, Yi Sun wrote: >Hello guys, > >We are planning the server disk space, pg_wal directory max size is wal >file size*wal_keep_segments? or is it also decided by other parameters >please? We tried to search for this, but could not find the answer > >For example our

Re: Drop role cascade ?

2022-11-17 Thread Andreas Kretschmer
at those commands >>> would actually do. >> Hmph. I'm surprised to realize that those commands don't produce >> trace output comparable to DROP CASCADE. If they did, this need >> would be met by the traditional hack of "BEGIN; DROP ...; ROLLBACK". > >So... you'll add it to v16  :D > +1 as feature request -- Andreas Kretschmer, EDB

Re: Findout long unused tables in database

2022-09-27 Thread Andreas Kretschmer
pg_stat_user_tables. There can you find how often the table was queried in the past. Take the data, wait some time, take it again and compare. Regards, Andreas -- Andreas Kretschmer Technical Account Manager (TAM) www.enterprisedb.com

Re: lifetime of the old CTID

2022-07-05 Thread Andreas Kretschmer
Am 06.07.22 um 07:54 schrieb Andreas Kretschmer: Am 06.07.22 um 07:44 schrieb Christophe Pettus: On Jul 5, 2022, at 22:35, Matthias Apitz wrote: Internally, in the DB layer, the read_where() builds the row list matching the WHERE clause as a SCROLLED CURSOR of     SELECT ctid, * FROM

Re: lifetime of the old CTID

2022-07-05 Thread Andreas Kretschmer
on the table, and using that instead. 100% ACK. Andreas -- Andreas Kretschmer Technical Account Manager (TAM) www.enterprisedb.com

Re: Postgres Wal Full

2022-03-03 Thread Andreas Kretschmer
On 3 March 2022 08:46:45 CET, pgdba pgdba wrote: >Hi , > >I have a problem from pg_wal. I am using postgresql version 11 and taking >backup and writing archive_command in postgresql.conf but did not archive wal >and my disk ise full from pg_wal. I research why is my wal is full and dont >found

Re: Max# of tablespaces

2021-01-05 Thread Andreas Kretschmer
On 3 January 2021 13:59:31 CET, Thomas Flatley wrote: >Hello, I've checked the docs but cant seem to find if there is a max # >of tablespaces allowed - I've come across a 9.5 env with 1600 >tablespaces - they want to double that why on earth do you think you will need so many tablespaces? They

Re: PostgreSQL HA

2020-12-28 Thread Andreas Kretschmer
Am 26.12.20 um 17:20 schrieb venkata786 k: Hi Ganesh, BDR supports postgres 12 & 13 versions ?? I think we have BDR compatible for 9.4 postgres. Could you plz confirm. That's true. PG 9.4 is out of support. Regards, Andreas -- 2ndQuadrant, an EDB company www.2ndQuadrant.com /

Re: Upgrade 9.4 to 12 on windows system

2020-11-19 Thread Andreas Kretschmer
Am 19.11.20 um 15:05 schrieb Asya Nevra Buyuksoy: connection to database failed: could not connect to server: Connection refused (0x274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 50432? could not connect to server: Connection

Re: Is it possible to write a generic UPSERT?

2020-11-12 Thread Andreas Kretschmer
Am 12.11.20 um 18:34 schrieb Michael Lewis: MERGE command is implemented for this use case in some DBMS, but not Postgres (yet?). MERGE is available in 2ndqPostgres, but that's not open source (it's available for 2ndQ-customers on request). Regards, Andreas -- 2ndQuadrant, an EDB

Re: PANIC: could not write to log file {} at offset {}, length {}: Invalid argument

2020-11-04 Thread Andreas Kretschmer
On 4 November 2020 11:24:03 CET, Shani Israeli wrote: >Hi all, > >We are running PostgreSQL v9.5.19 over Windows Server 2012 R2, 16GB >RAM. >Lately, postgres started to crash (happened already 3 times ~once a >month) >and before its crashes I found this message in Event Log: > >PANIC: could not

Re: archive command in streaming replication in windows server

2020-10-29 Thread Andreas Kretschmer
Am 29.10.20 um 20:12 schrieb Atul Kumar: hi, I am trying to configure streaming replication on windows server. i have postgres version 10 after successful installation of postgres, I create a archive directory "C:\Program Files\PostgreSQL\10\archive_files" and here in archive_flies, I

Re: Feature Requests

2020-10-25 Thread Andreas Kretschmer
Am 25.10.20 um 10:26 schrieb Nikolai Lusan: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hi, I was wondering where I can see open feature requests. One I would like to see is multi-master replication ... I did find a 2016 request that was marked as "planned", but to the best of my

bug in PG13?

2020-10-14 Thread Andreas Kretschmer
Hi all, it seems to me a bug. i have a partitioned table: test=*# select version(); version -  PostgreSQL 13.0 (Ubuntu 13.0-1.pgdg18.04+1) on x86_64-pc-linux-gnu,

Re: Wal_keep_segment value too high

2020-07-10 Thread Andreas Kretschmer
On 10 July 2020 10:26:25 CEST, Brajendra Pratap Singh wrote: >Hi, > >What will happen if the wal_keep_segments value is too high ,is this wasted disk space. What do you want to achive? Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company

Re: Postgresql HA Cluster

2020-06-29 Thread Andreas Kretschmer
Am 29.06.20 um 09:33 schrieb Laurenz Albe: That would not provode a multi-master solution, though. There are some commercial solutions for that, but be warned that it would require non-trivial changes to your application. not really with BDR3 ;-) Andreas -- 2ndQuadrant - The PostgreSQL

Re: [HELP] query regarding replication

2020-06-09 Thread Andreas Kretschmer
Am 09.06.20 um 10:44 schrieb Praveen Kumar K S: Thanks. Will this approach replicate DDL changes ? sure. Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2ndQuadrant.com

Re: [HELP] query regarding replication

2020-06-09 Thread Andreas Kretschmer
Am 09.06.20 um 09:55 schrieb Praveen Kumar K S: Can I achieve master/slave streaming replication by setting WAL_LEVEL to logical on master ? Are there any drawbacks of it ? yes, no problem. the wal's would be a bit larger, that's all. Regards, Andreas -- 2ndQuadrant - The PostgreSQL

Re: Regarding creation of gin index on column that has varchar datatype

2020-05-23 Thread Andreas Kretschmer
Am 23.05.20 um 12:37 schrieb Durgamahesh Manne: Hi Respected to PGDG GLOBAL TEAM I am getting this error( ERROR:  data type character varying has no default operator class for access method "gin" HINT:  You must specify an operator class for the index or define a default operator class

Re: pg_dump crashes

2020-05-22 Thread Andreas Kretschmer
Am 22.05.20 um 14:37 schrieb Nico De Ranter: Postgres version: 9.5 which minor-version? Can you check if the table has TOAST-Tables? Can you try to select all columns but not TOASTed columns? Maybe there is data-corruption only in toast-tables. Regards, Andreas -- 2ndQuadrant - The

Re: Clarification related to BDR

2020-05-14 Thread Andreas Kretschmer
Am 14.05.20 um 06:37 schrieb Santhosh Kumar: Can you please help me understand, why the following news is published in "postgresql" with an encouraging message acknowledging BDR as an open source? We invested time and effort to use BDR only to understand at a later point in time, that it is

Re: pg11: Query using index, but only for half the partitions

2020-04-23 Thread Andreas Kretschmer
Am 23.04.20 um 12:30 schrieb Stefan Knecht: There's no question that this is more expensive than just reading the 95 rows from the index directly and returning them not sure, you can play with enable_seqscan = off and compare the costs. What is the setting for random_page_cost ?

Re: pg11: Query using index, but only for half the partitions

2020-04-23 Thread Andreas Kretschmer
Am 23.04.20 um 10:13 schrieb Stefan Knecht: Seq Scan on snap_20200225 s  (cost=0.00..1.19 rows=1 width=12) the partition is very small, so it's cheaper to scan only the table (one block) than index + table (1 + 1 block). Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company.

Re: PostgreSQL native multi-master

2020-04-07 Thread Andreas Kretschmer
Am 07.04.20 um 13:39 schrieb Vano Beridze: Hello, What are the plans to support multi-master natively? What solution would you recommend at this point? preferably free. BDR3 works well for our customers, but it isn't free. You can ask us for more information. Regards, Andreas --

Re: Real application clustering in postgres.

2020-03-09 Thread Andreas Kretschmer
Am 05.03.20 um 13:07 schrieb Laurenz Albe: There is a closed-source implementation that you can buy: https://www.2ndquadrant.com/en/resources/postgres-bdr-2ndquadrant/ But multi-master replication is complicated to get right, and an applicatoin that uses it has to be specifically designed

Re: Who mades the inserts?

2020-03-09 Thread Andreas Kretschmer
Am 09.03.20 um 13:52 schrieb Durumdara: Do you know any query which can show me the inserts per databases? And I don't know it works as TPS query? So I need to make differents between measured values in two time point? yes, you can use tup_inserted from pg_stat_database. Regards,

Re: Backup & Restore

2020-02-24 Thread Andreas Kretschmer
Am 24.02.20 um 09:18 schrieb Dor Ben Dov: Hi All, What is your backup and restore solution in production when working with Postgres ? most of our customers using Barman: https://www.pgbarman.org/ Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2ndQuadrant.com

Re: How to avoid UPDATE on same data in table ?

2020-02-02 Thread Andreas Kretschmer
Am 02.02.20 um 18:18 schrieb Tom Lane: https://www.postgresql.org/docs/current/functions-trigger.html regards, tom lane cool. Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2ndQuadrant.com

Re: How to avoid UPDATE on same data in table ?

2020-02-02 Thread Andreas Kretschmer
Am 02.02.20 um 14:37 schrieb Andreas Kretschmer: Am 02.02.20 um 10:24 schrieb Condor: CREATE TRIGGER last_changes   BEFORE UPDATE ON status_table   FOR EACH ROW   WHEN (OLD.* IS DISTINCT FROM NEW.*) try to exclude the column lastchange from the comparison. test=*# select ctid

Re: How to avoid UPDATE on same data in table ?

2020-02-02 Thread Andreas Kretschmer
Am 02.02.20 um 10:24 schrieb Condor: CREATE TRIGGER last_changes   BEFORE UPDATE ON status_table   FOR EACH ROW   WHEN (OLD.* IS DISTINCT FROM NEW.*) try to exclude the column lastchange from the comparison. Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2ndQuadrant.com

Re: pg_stat_statements extension

2020-01-16 Thread Andreas Kretschmer
On 13 January 2020 20:15:21 CET, Rushikesh socha wrote: >HI, Is there any good link that shows how to install pg_stat_statements >extension >I am getting below error > >postgres=# CREATE EXTENSION pg_stat_statements; >ERROR: could not open extension control file

Re: Backup and Restore

2019-12-25 Thread Andreas Kretschmer
Am 25.12.19 um 14:34 schrieb Dor Ben Dov: Hi All, What Is the best recommended / used tool for backup and restore that you suggest or work with postgres ? depends on your needs, most of our customers using barman. Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company.

Re: Backup and Restore

2019-12-12 Thread Andreas Kretschmer
Am 12.12.19 um 16:12 schrieb Dor Ben Dov: What is the most common used back and restore solution for postgres ? most of our customers are using Barman, which is not a surprise since it is developed by us ;-) Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company.

Re: Upgrade PostgreSQL 9.6 to 10.6

2019-12-10 Thread Andreas Kretschmer
Am 09.12.19 um 23:37 schrieb github kran: Great, thanks Andreas, So this seems to be a good feature using the core concept of replication. Can I use this extension and do the major upgrade without paying ?. yes, this extension is free. Regards, Andreas -- 2ndQuadrant - The PostgreSQL

Re: Upgrade PostgreSQL 9.6 to 10.6

2019-12-09 Thread Andreas Kretschmer
Am 09.12.19 um 16:43 schrieb github kran: Hello PostgreSQL Team, I would like to know what would be the best way to do Database migration from PostgreSQL 9.6 engine to 10.6 by creating a new cluster in 10.6 and then copy data. Size of the cluster is 3.8 TB. 1) It would be a new cluster

Re: security on user for replication

2019-11-11 Thread Andreas Kretschmer
Am 11.11.19 um 14:26 schrieb PegoraroF10: How can I hide that info from users which are connected to my replica server you can use a .pgpass - file, see the documentation. Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2ndQuadrant.com

Re: Can you please suggest how to configure hot_standby_feedback?

2019-10-31 Thread Andreas Kretschmer
Am 31.10.19 um 06:21 schrieb M Tarkeshwar Rao: Can you please suggest how to configure hot_standby_feedback? turn it on if you want execute long running queries on the standby, keep in mind it can lead to more bloat on the master. Regards, Andreas -- 2ndQuadrant - The PostgreSQL

Re: Postgres Point in time Recovery (PITR),

2019-10-18 Thread Andreas Kretschmer
On 18 October 2019 07:59:21 CEST, Daulat Ram wrote: >Hello All, >Can you please share some ideas and scenarios how we can do the PITR in >case of disaster. > > >Thanks, Consider Barman. -- 2ndQuadrant - The PostgreSQL Support Company

Re: GPS coordinates problem

2019-10-08 Thread Andreas Kretschmer
Am 08.10.19 um 12:50 schrieb Timmy Siu: Now, I need Global Position System coordinates as a data type. How do I define it in Postgresql 11 or 12? consider PostGIS. Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2ndQuadrant.com

Re: Postgres 12: backend crashes when creating non-deterministic collation

2019-10-04 Thread Andreas Kretschmer
Am 04.10.19 um 12:13 schrieb Thomas Kellerer: I was trying to learn how the new non-deterministic collations in v12 work, but the following makes the backend crash: CREATE COLLATION de_ci (provider = icu, locale = 'de-x-icu', deterministic = false); Which leads to: 2019-10-04 11:54:23

Re: pg_receivexlog or archive_command

2019-09-23 Thread Andreas Kretschmer
Am 23.09.19 um 13:44 schrieb Luca Ferrari: On Mon, Sep 23, 2019 at 10:55 AM Andreas Kretschmer wrote: you can use both of them, and you should consider "Barman". If I remember well Barman uses pg_receivexlog when streaming, and archive_command when doing a "normal&qu

Re: pg_receivexlog or archive_command

2019-09-23 Thread Andreas Kretschmer
Am 23.09.19 um 10:25 schrieb Vikas Sharma: Hi, I am wondering which one is the best way to archive the xlogs for Backup and Recovery - pg_receivexlog or archive_command. pg_receivexlog seems best suited because the copied/archived file is streamed as it is being written to in xlog while

Re: BDR: moving a node

2019-08-26 Thread Andreas Kretschmer
Am 25.08.19 um 18:11 schrieb E: What is the process to update the DSN? I assume I'll have to relay the changes in my pg_hba.conf, but do not understand, and don't want to tinker, with BDR before obtaining some educated advice. I apologize if my question comes across as dumb. I understand I

Re: how to upgrade production PostgreSQL from 9.4 to 11.3

2019-06-12 Thread Andreas Kretschmer
Am 12.06.19 um 14:50 schrieb Rahul Chordiya: postgres=# postgres=# select subscription_name, status FROM pglogical.show_subscription_status();  subscription_name | status ---+ (0 rows) postgres=# select pglogical.create_subscription(subscription_name :=

Re: Featured Big Name Users of Postgres

2019-06-11 Thread Andreas Kretschmer
On 11 June 2019 19:45:27 CEST, Igal Sapir wrote: >I'm doing a presentation about Postgres to SQL Server users this >weekend, >and I want to showcase some of the big names that use Postgres, e.g. >MasterCard, Government agencies, Banks, etc. > >There used to be a Wiki page of Featured Users but

Re: Drive Architecture for new PostgreSQL Environment

2019-06-10 Thread Andreas Kretschmer
Am 10.06.19 um 18:35 schrieb Hilbert, Karin: We did this as a precaution against disk failure.  If we lose one, we would still have the other two to recover from. Is that really necessary anymore, with having a repmgr cluster? Repmgr is for HA, not for Backup/Recovery. Regards,

Re: table is hanging

2019-05-31 Thread Andreas Kretschmer
Am 31.05.19 um 14:06 schrieb Saurabh Agrawal: Which query are you trying to run? you can show us also the EXPLAIN - Output. Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2ndQuadrant.com

Re: with and trigger

2019-05-29 Thread Andreas Kretschmer
> >Are CTEs still optimization fences? >https://www.2ndquadrant.com/en/blog/postgresql-ctes-are-optimization-fences/ Yes, but not in 12. Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company

Re: POSTGRES_FSM_RELATIONS CRITICAL: DB control fsm relations used: 79569 of 80000 (99%)

2019-05-28 Thread Andreas Kretschmer
On 28 May 2019 20:20:10 CEST, Julie Nishimura wrote: >What is the impact of fsm_relatiosn being maxed out? https://www.postgresql.org/docs/8.2/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-FSM Please no top-posting with fullquote. Regards, Andreas -- 2ndQuadrant - The PostgreSQL

Re: How to search using daterange (using gist)

2019-05-16 Thread Andreas Kretschmer
Am 16.05.19 um 11:57 schrieb Winanjaya Amijoyo: Hi All, I have records as below that I inserted using exclusion gist constraint user_id    start_date      end_date         pid 001          2019-01-01    2019-02-10        1 001          2019-02-01    2019-03-12        2 001         

Re: Import Database

2019-05-06 Thread Andreas Kretschmer
Am 05.05.19 um 19:26 schrieb Ron: On 5/5/19 12:20 PM, Andreas Kretschmer wrote: Am 05.05.19 um 18:47 schrieb Sathish Kumar: Is there a way to speed up the importing process by tweaking Postgresql config like maintenance_workmem, work_mem, shared_buffers etc., sure, take the dump

Re: Import Database

2019-05-05 Thread Andreas Kretschmer
Am 05.05.19 um 18:47 schrieb Sathish Kumar: Is there a way to speed up the importing process by tweaking Postgresql config like maintenance_workmem, work_mem, shared_buffers etc., sure, take the dump in custom-format and use pg_restore with -j . You can increase maintenance_work_mem maybe

Re: Multicolumn index for single-column queries?

2019-04-18 Thread Andreas Kretschmer
Am 18.04.19 um 08:52 schrieb rihad: Hi. Say there are 2 indexes:     "foo_index" btree (foo_id)     "multi_index" btree (foo_id, approved, expires_at) foo_id is an integer. Some queries involve all three columns in their WHERE clauses, some involve only foo_id. Would it be ok from

Re: SQLSTATE when PostgreSQL crashes during COMMIT statement

2019-04-15 Thread Andreas Kretschmer
Am 15.04.19 um 12:41 schrieb Francisco Olarte: On Mon, Apr 15, 2019 at 4:11 AM Takahashi, Ryohei wrote: If application executes COMMIT statement and COMMIT failes because of PostgreSQL crash, it is unknown whether the transaction is really committed. Therefore, I think application should

Re: SELECT query fails after pg_upgrade as the conditional operator fails

2019-04-13 Thread Andreas Kretschmer
Am 13.04.19 um 11:22 schrieb Nithin Johnson: We are seeing this intermittent problem after we upgrade (using pg_upgrade) from postgres 9.3.12 to 9.6.12 Querying  few of the rows in the table using a TEXT field is failing. sounds like a corrupt index, can you show us the complete error

Re: Table Export & Import

2019-04-01 Thread Andreas Kretschmer
On 1 April 2019 08:09:37 CEST, Sathish Kumar wrote: >Hi Team, > >We have a requirement to copy a table from one database server to >another >database server. We are looking for a solution to achieve this with >lesser >downtime on Prod. Can you help us with this? > >Table Size: 160GB >Postgresql

Re: Archival process of partition tables with filtering few rows from tables.

2019-03-28 Thread Andreas Kretschmer
On 29 March 2019 05:13:31 CET, github kran wrote: >Hello Team, > >We are using PostgreSQL Version 9.6 and planning to archive our >partition >tables containing about 300 - 500 million rows . We have around ~ 50 >partition tables to be archived to a new >cold path PostgreSQL database , version

Re: Case Insensitive

2019-03-28 Thread Andreas Kretschmer
Am 28.03.19 um 09:33 schrieb Sameer Kumar: test=*# select * from emp where ename = 'aaa';   eid | ename -+---     1 | aaa     2 | AAA (2 rows) Ummm... Will it use an index (a BTree index)? test=# explain select * from emp where ename = 'aaa';

Re: Case Insensitive

2019-03-28 Thread Andreas Kretschmer
Am 28.03.19 um 09:20 schrieb Sridhar N Bamandlapally: Hi PG-General and Pgsql-Admin Can we achieve CASE INSENSITIVE in PostgreSQL? test=# create extension citext; CREATE EXTENSION test=*# create table emp (eid int, ename citext); CREATE TABLE test=*# insert into emp values (1, 'aaa');

Re: Conditional INSERT

2019-03-15 Thread Andreas Kretschmer
Am 15.03.19 um 18:55 schrieb basti: Hello, I want to insert data into table only if condition is true. For example: INSERT into mytable (domainid, hostname, txtdata) VALUES (100,'_acme.challenge.example', 'somedata'); The insert should only be done if Hostname like %_acme.challenge%.

Re: Ran out of memory retrieving query results.

2019-03-11 Thread Andreas Kretschmer
Am 11.03.19 um 06:44 schrieb Nanda Kumar: Hello Tem, Can you please help on the below issues . The below Error occurred when I run the select statement for the huge data volume. Error Details : Ran out of memory retrieving query results. you should provide more details, for instance

Re: Postgres 10 temp tablespace question

2019-03-09 Thread Andreas Kretschmer
Am 09.03.19 um 02:05 schrieb Joseph Dunleavy: I am building a multi-tenant deployment with multiple database - 1 tenant per database. I would like to be able to dedicate specific temp tablespace to a specific database or user/schemas. I understand how to define temp_tablespace in

Re: Non-pausing table scan on 9.6 replica?

2019-03-05 Thread Andreas Kretschmer
Am 06.03.19 um 06:41 schrieb Mark Fletcher: Thank you for responding to my email. On Tue, Mar 5, 2019 at 9:20 PM Andreas Kretschmer mailto:andr...@a-kretschmer.de>> wrote: have you set ```max_standby_streaming_delay``? The default is 30 seconds, which

Re: write on standby

2019-03-05 Thread Andreas Kretschmer
On 6 March 2019 06:26:45 CET, Julie Nishimura wrote: >Thank you. Are you going to have any presentations on Postgresql >conference in NYC soon? > > >From: Andreas Kretschmer >Sent: Tuesday, March 5, 2019 9:16 PM >To: pgsql-general@lists.postgr

Re: Non-pausing table scan on 9.6 replica?

2019-03-05 Thread Andreas Kretschmer
Am 06.03.19 um 01:26 schrieb Mark Fletcher: Hi All, On a 9.6 streaming replica, we do table scans for stats and other things. During these scans, the replication is paused (the 'recovering' postgres process has 'waiting' appended to it). We're not using transactions with these scans. Is

Re: write on standby

2019-03-05 Thread Andreas Kretschmer
Am 06.03.19 um 00:34 schrieb Julie Nishimura: Hello there, Is it possible for a test app to connect to the standby dB of an active-Standby dB pair? that's possible, but ... While both continue to be connected and replicating? What if it’s needed to write tmp tables that are later

Re: LIMIT not showing all results

2019-03-05 Thread Andreas Kretschmer
Am 05.03.19 um 19:41 schrieb Casey Deccio: On Mar 5, 2019, at 10:37 AM, Andreas Kretschmer mailto:andr...@a-kretschmer.de>> wrote: no, but you can set enable_indexscan to off and maybe also enable_bitmapscan to off to force the planner to choose a seq-scan. I'm sure in this ca

Re: [External] LIMIT not showing all results

2019-03-05 Thread Andreas Kretschmer
Am 05.03.19 um 19:09 schrieb Matthew Pounsett: On Tue, 5 Mar 2019 at 12:54, Tom Lane <mailto:t...@sss.pgh.pa.us>> wrote: Andreas Kretschmer mailto:andr...@a-kretschmer.de>> writes: > the other thing is, it would be nice to to know why the index is c

Re: [External] LIMIT not showing all results

2019-03-05 Thread Andreas Kretschmer
On 5 March 2019 18:54:33 CET, Tom Lane wrote: >Andreas Kretschmer writes: >> the other thing is, it would be nice to to know why the index is >corrupt. > >Given that (a) this was triggered by a server migration and (b) >the leading column of the index looks like it's p

Re: [External] LIMIT not showing all results

2019-03-05 Thread Andreas Kretschmer
Am 05.03.19 um 17:51 schrieb Vijaykumar Jain: Thanks Tom. I mean if the instance is a test instance, probably analysis_name_date_key can be dropped and the query can be run again so as to check if it still returns the correct rows. or create an index in parallel with the same col as

Re: Replication

2019-02-26 Thread Andreas Kretschmer
On 26 February 2019 10:41:19 CET, Sonam Sharma wrote: >Hi, > >Can we do master to master replication in Postgres. > Not in core, but with BDR. Andreas -- 2ndQuadrant - The PostgreSQL Support Company

  1   2   3   >