Re: sequence id overflow ERROR using timescaledb

2022-08-04 Thread Julien Rouhaud
Hi, On Thu, Aug 04, 2022 at 08:47:16PM +, abrahim abrahao wrote: > >  I am using timescaledb version  2.7.2, and PostgreSQL 12.11 > [...] > I tried to compress a chuck using the compress_chunk function and running a > job as well, and I got "sequence id overflow" message ERROR.Any idea how to

Re: Purpose of DEFERRABLE _and_ INITIALLY DEFERRED foreign key constraint checking?

2022-08-04 Thread Jan Wieck
On 8/3/22 20:30, Ron wrote: AWS RDS Postgresql 12.10 https://www.postgresql.org/docs/12/sql-createtable.html [quote] |DEFERRABLE| |NOT DEFERRABLE| This controls whether the constraint can be deferred. A constraint that is not deferrable will be checked immediately after every

Re: PostgreSQL 14.4 ERROR: out of memory issues

2022-08-04 Thread Joe Conway
On 8/4/22 08:34, Aleš Zelený wrote: SELECT ... simple join of two tables...       WHERE opd.id_data_provider = _id_data_provider         AND CASE WHEN _external_id IS NULL                  THEN external_id IS NULL                  ELSE external_id = _external_id             END         AND CASE

sequence id overflow ERROR using timescaledb

2022-08-04 Thread abrahim abrahao
 I am using timescaledb version  2.7.2, and PostgreSQL 12.11 (Ubuntu 12.11-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit I tried to compress a chuck using the compress_chunk function and running a job as well, and I got "sequence id

follower never to become master

2022-08-04 Thread Marco Lechner
Hi, using Patroni, is there an configuration option that makes a follower never become master if the master fails (but other followers of course). I want to add a follower to a patroni cluster that can be used as a separate readonly endpoint to the DB not affecting the rest of the cluster. So

Re: Index only scans for expressional indices when querying for the expression

2022-08-04 Thread Tom Lane
Danny Shemesh writes: > Do you think there'd be room to accept a contribution for such > functionality with a disabled-by-default pg setting, > or are you skeptical it would ever be worth the trade-off ? If you can show me a matching algorithm with non-exponential runtime, I'd be interested.

Re: Index only scans for expressional indices when querying for the expression

2022-08-04 Thread Danny Shemesh
A-ha, interesting ! I think we have some specific use cases where it'd be worth the overhead, I'd need to measure it, though; Do you think there'd be room to accept a contribution for such functionality with a disabled-by-default pg setting, or are you skeptical it would ever be worth the

Re: Allow user to connect to replicas only

2022-08-04 Thread hubert depesz lubaczewski
On Thu, Aug 04, 2022 at 03:42:00PM +0200, Wiwwo Staff wrote: > Is there any way to create a user allowed to connect to a/any read replica > only, as in "not allowed to connect to primary"? Sure. Modify pg_hba.conf on primary to disallow connections as this user. Best regards, depesz

Allow user to connect to replicas only

2022-08-04 Thread Wiwwo Staff
Hi! Is there any way to create a user allowed to connect to a/any read replica only, as in "not allowed to connect to primary"?

Re: Index only scans for expressional indices when querying for the expression

2022-08-04 Thread Tom Lane
Danny Shemesh writes: > That is of course correct, but what I mean is that, I think that if one > would explicitly query f(x), and never for x directly, it would've been > theoretically possible to say that the index is covering for every f(x), > wouldn't it ? Theoretically, yeah, but we don't

Re: PostgreSQL 14.4 ERROR: out of memory issues

2022-08-04 Thread Aleš Zelený
Hello, thanks for the information and the link! Ales čt 4. 8. 2022 v 1:05 odesílatel Tom Lane napsal: > =?UTF-8?B?QWxlxaEgWmVsZW7DvQ==?= writes: > > CREATE OR REPLACE FUNCTION tescase (_id_data_provider integer, > _external_id > > bigint DEFAULT NULL::bigint, _external_complete_id character

Re: Index only scans for expressional indices when querying for the expression

2022-08-04 Thread Danny Shemesh
Hey David - thanks for the prompt response ! That is of course correct, but what I mean is that, I think that if one would explicitly query f(x), and never for x directly, it would've been theoretically possible to say that the index is covering for every f(x), wouldn't it ? Or in other words,

Re: Index only scans for expressional indices when querying for the expression

2022-08-04 Thread David G. Johnston
On Thursday, August 4, 2022, Danny Shemesh wrote: > > I believe the expressional index in itself could've been considered as > covering, when querying for the expression explicitly. > This belief is wrong. When storing f(x) there is no way to recover the value of x. David J.

Re: Behavior of identity columns

2022-08-04 Thread Francisco Olarte
On Thu, 4 Aug 2022 at 10:52, sivapostg...@yahoo.com wrote: > I see 'identity' column values increment even when some error(s) occurs while > inserting data. Is that a known bug or known behavior? Known behaviour, explained thousand of times over the years. Identity is not a way to generate

Re: How to choose new master from slaves.?

2022-08-04 Thread Ron
On 8/4/22 02:43, Sacheen Birhade wrote: Hi All, I have a very basic question about streaming replication feature of Postgres. Let’s assume I have servers A, B, C, D, & E with postgres installed with streaming replication as follow: A à B ( sync replication ) A à C ( async replication ) A

Index only scans for expressional indices when querying for the expression

2022-08-04 Thread Danny Shemesh
Hello everyone, Quick question here about index-only scans and expressional indices, tested on postgres <= 14, Say I have a column, and an expressional index on said column (fiddle ) - e.g. create table t1 (x text); create index idx_upper

Re: Behavior of identity columns

2022-08-04 Thread sivapostg...@yahoo.com
Hello, I see 'identity' column values increment even when some error(s) occurs while inserting data.  Is that a known bug or known behavior? Create script of table: CREATE TABLE public.users(    id integer NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1

Re: BUG #17567: Unable to Set Max_Connection in Postgresql which has replicas

2022-08-04 Thread Mateusz Henicz
Hey, It is not a bug. If you are using patroni, you should change your parameters in patroni configuration yaml file, so the changes are reflected in your Distributed Configuration Store. If you would look at the Patroni documentation ( https://patroni.readthedocs.io/en/latest/SETTINGS.html) you

Re: Unable to start replica after failover

2022-08-04 Thread Kyotaro Horiguchi
At Fri, 29 Jul 2022 15:01:44 +, "Lahnov, Igor" wrote in > * "could not find previous WAL record at E6F/C2436F50: invalid > resource manager ID 139 at E6F/C2436F50"; or > * "could not find previous WAL record at 54E/FB348118: unexpected > pageaddr 54E/7B34A000 in log

Re: Is Client connections via ca.crt only possible?

2022-08-04 Thread Rejo Oommen
Thank you for the reply Thomas. I agree with you on the mutual TLS that you mentioned. Here is what I was looking at. The configurations at the server end will be with auth-method as md5 and auth-option as clientcert=verify-ca. In this way, the user's password along with the valid ca should

Re: BUG #17567: Unable to Set Max_Connection in Postgresql which has replicas

2022-08-04 Thread Poornima Venkatesan
Hi Team, PostgreSQL in our Production environment is configured using primary and secondary DB servers via Patroni. We have requirement to explicitly to set Max_Connection as 300 overriding default value. If we set Max_Connections in postgresql.config, it is getting reset post restart of Patroni.

Re: Purpose of DEFERRABLE _and_ INITIALLY DEFERRED foreign key constraint checking?

2022-08-04 Thread Francisco Olarte
Ron: On Thu, 4 Aug 2022 at 02:30, Ron wrote: > DEFERRABLE > NOT DEFERRABLE > This controls whether the constraint can be deferred. A constraint that is > not deferrable will be checked immediately after every command. Checking of > constraints that are deferrable can be postponed until the end

How to choose new master from slaves.?

2022-08-04 Thread Sacheen Birhade
Hi All, I have a very basic question about streaming replication feature of Postgres. Let's assume I have servers A, B, C, D, & E with postgres installed with streaming replication as follow: A --> B ( sync replication ) A --> C ( async replication ) A --> D ( async replication ) A --> E