Weird seqscan node plan

2019-11-25 Thread Игорь Выскорко
Hi all! I'm confused by planner choice: seqscan but not index scan when index scan cost is much cheaper. 1st plan: https://explain.depesz.com/s/Cti#l8 2nd plan (with "set enable_seqscan = off"): https://explain.depesz.com/s/qn0I#l8 Look at 8th row: this nested loop decided to join the second node

Re: I think that my data is saved correctly, but when printing again, other data appears

2019-11-25 Thread Yessica Brinkmann
Good afternoon, Well, I spent some time without implementing my thesis for a topic of mental fatigue, I had to go for a while. A few days ago I came back and was trying to implement the context change. But I really believe that, although I read the explanations and source codes that you indicated,

[11.6] WALs recovery ordering with Restore Command - timelines

2019-11-25 Thread Pavel Suderevsky
Hi, PostgreSQL 11.6 Centos 7.6 pgBackrest 2.19 Case: Master is on timeline 15 while Standby that should be synchronized with Master as a hot standby is on timeline 13. WALs to be obtained from archive. recovery.conf: >primary_conninfo = 'user=usename host=10.10.10.3 port=5432 sslmode=prefer app

Call Stored Procedure with inout parameters in c#

2019-11-25 Thread İlyas Derse
I tried with inout parameters but it did not work correctly. here is my procedure : CREATE OR REPLACE PROCEDURE public.testing ( INOUT x int ) LANGUAGE 'plpgsql' AS $$ BEGIN x := x * 3; END ; $$; my C# code: public void myMethod2() { CRUD.con.Open(); int a = 5

Re: casting Bangla characters to NUMERIC

2019-11-25 Thread Bob Jolliffe
select translate(string,'০১২৩৪৫৬৭৮৯','0123456789'); seems to do the trick. On Mon, 25 Nov 2019 at 16:38, Bob Jolliffe wrote: > > Thanks Tom. That is what I expected to hear. Was being hopeful ... > > On Mon, 25 Nov 2019 at 16:27, Tom Lane wrote: > > > > Bob Jolliffe writes: > > > I have an

Re: casting Bangla characters to NUMERIC

2019-11-25 Thread Bob Jolliffe
Thanks Tom. That is what I expected to hear. Was being hopeful ... On Mon, 25 Nov 2019 at 16:27, Tom Lane wrote: > > Bob Jolliffe writes: > > I have an interesting problem. I have a string field in a table which > > (sometimes) is expected to contain numeric values ie. a cast of the > > fiel

Re: casting Bangla characters to NUMERIC

2019-11-25 Thread Tom Lane
Bob Jolliffe writes: > I have an interesting problem. I have a string field in a table which > (sometimes) is expected to contain numeric values ie. a cast of the > field to INTEGER is supposed to succeed. > My issue is that the application is running in Bangladesh, and > sometimes the users ha

casting Bangla characters to NUMERIC

2019-11-25 Thread Bob Jolliffe
Hi I have an interesting problem. I have a string field in a table which (sometimes) is expected to contain numeric values ie. a cast of the field to INTEGER is supposed to succeed. My issue is that the application is running in Bangladesh, and sometimes the users have entered values using Bang

Re: Pgadmin 4 schema visibility

2019-11-25 Thread Adrian Klaver
On 11/24/19 11:55 PM, Jill Jade wrote: Hello everyone, I am using Postgres 11 with Pgadmin4. System schemas pg_temp and pg_toast are not visible when I do \dn+ in psql. But when I do SELECT nspname FROM pg_catalog.pg_namespace;, I see the schemas. namespace.jpg dn.PNG pgadmin4.PNG Can anyon

Re: Adding LIMIT changes PostgreSQL plan from good to a bad one

2019-11-25 Thread Michael Korbakov
On November 22, 2019 at 20:28:39, Michael Lewis (mle...@entrata.com) wrote: I try to avoid DISTINCT and use GROUP BY when feasible, as well as avoiding OR condition. If you combined anon1 and anon2 with UNION ALL, and did (inner) join instead of left, or even moved all of that to EXISTS, perhaps t

Re: Constants in the foreighn key constraints

2019-11-25 Thread aleksey ksenzov
Hi team. Thanks for the information. Looks like there're some architectural limitations for such foreign keys. Also thanks for the suggestions on how to make it behaving like I want on current postgres version. On Sat, 23 Nov 2019, 19:11 Tom Lane, wrote: > Adrian Klaver writes: > > Please reply

AW: sql query for postgres replication check

2019-11-25 Thread Zwettler Markus (OIZ)
> On Fri, Nov 22, 2019 at 01:20:59PM +, Zwettler Markus (OIZ) wrote: > > I came up with the following query which should return any apply lag in > > seconds. > > > > select coalesce(replay_delay, 0) replication_delay_in_sec from ( > >select datname, > > ( > >