Re: libpq stricter integer parsing

2018-09-08 Thread Michael Paquier
On Fri, Sep 07, 2018 at 11:22:14PM +0200, Fabien COELHO wrote: > Weird indeed. However, even if the patch applied cleanly for me, it was not > compiling anymore. Attached an updated version, in which I also tried to > improve the error message on trailing garbage. At least now it applies for me,

Re: RULE does not like the NOT EXISTS condition

2018-09-08 Thread Andrew Gierth
> "Andrew" == Andrew Gierth writes: > "Szima" == Szima Gábor writes: Szima> Hi! Szima> I found an "interest" in RULE's operation: Andrew> All non-trivial* rules are wrong, I should of course add: the solution is to use triggers instead, which are much easier to understand and have

Re: remove duplicated words in comments .. across lines

2018-09-08 Thread Michael Paquier
On Fri, Sep 07, 2018 at 08:31:09PM -0500, Justin Pryzby wrote: > Resending to -hackers as I realized this isn't a documentation issue so not > appropriate or apparently interesting to readers of -doc. > > I should probably just call the algorithm proprietary, but if you > really wanted to know,

Re: [HACKERS] [BUGS] BUG #14825: enum type: unsafe use?

2018-09-08 Thread Thomas Munro
On Thu, Jan 11, 2018 at 3:01 PM Thomas Munro wrote: > So I agree with Tom's suggestion: > > On Wed, Oct 4, 2017 at 2:29 PM, Tom Lane wrote: > > Perhaps serialize the contents into an array in DSM, then rebuild a hash > > table from that in the worker. Robert might have a better idea though. > >

Re: Prevent concurrent DROP SCHEMA when certain objects are being initially created in the namespace

2018-09-08 Thread Tom Lane
Michael Paquier writes: > This way if any refactoring is done with this routine, then we don't > break schema lock logic. Andres, Tom and others, any objections? I'm still not very happy about this, mainly because it seems like (a) it's papering over just a small fraction of the true problem

Re: RULE does not like the NOT EXISTS condition

2018-09-08 Thread Andrew Gierth
> "Szima" == Szima Gábor writes: Szima> Hi! Szima> I found an "interest" in RULE's operation: All non-trivial* rules are wrong, and this is a good illustration of why. CREATE RULE ruletest_rule AS ON INSERT TO ruletest DO INSERT INTO rulelog (id) VALUES (NEW.id); INSERT INTO ruletest

Re: Does logical replication slot itself would be physically replicated to slaves?

2018-09-08 Thread Michael Paquier
On Sat, Sep 08, 2018 at 05:37:43PM +0800, Jinhua Luo wrote: > The logical streaming replication is used to replicate changes between > DC. I need to confirm that whether the logical replication slot would > be saved in wal and replicated to slave via physical replication? So > that in case of

RULE does not like the NOT EXISTS condition

2018-09-08 Thread Szima Gábor
Hi! I found an "interest" in RULE's operation: CREATE TABLE ruletest (id int4); CREATE TABLE rulelog (id int4, ts timestamp NOT NULL DEFAULT current_timestamp); CREATE RULE ruletest_rule AS ON INSERT TO ruletest DO INSERT INTO rulelog (id) VALUES (NEW.id); INSERT INTO ruletest (id) VALUES

Re: Prevent concurrent DROP SCHEMA when certain objects are being initially created in the namespace

2018-09-08 Thread Michael Paquier
On Thu, Sep 06, 2018 at 05:19:15PM -0300, Fabrízio de Royes Mello wrote: > I also run some similar tests as Jimmy pointed and using PLpgSQL to execute > DDLs and the new consistent behavior is ok. Also I run one session using > DROP SCHEMA at end and after COMMIT the session 2 report 'ERROR:

Re: Prevent concurrent DROP SCHEMA when certain objects are being initially created in the namespace

2018-09-08 Thread Michael Paquier
On Sat, Sep 08, 2018 at 04:21:34PM -0400, Tom Lane wrote: > I'm still not very happy about this, mainly because it seems like > (a) it's papering over just a small fraction of the true problem Check. > (b) there's been no discussion about cost-benefit tradeoffs. Noted. I am not sure how to

Sv: Re: Query is over 2x slower with jit=on

2018-09-08 Thread Andreas Joseph Krogh
På torsdag 23. august 2018 kl. 09:14:56, skrev Andreas Joseph Krogh < andr...@visena.com >: På torsdag 23. august 2018 kl. 03:00:42, skrev Jonathan S. Katz < jk...@postgresql.org >: > On Aug 22, 2018, at 7:13 PM, Andres Freund wrote:

How to find local logical replication origin?

2018-09-08 Thread Jinhua Luo
Hi All, What's the local logical replication origin, which could be used to filter local changes in the replication slot? In other words, I'm curious that what's the default replication origin? Because normal DML locally does not set any origin explicitly, correct?

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2018-09-08 Thread Fabien COELHO
Hello Marina, About the two first preparatory patches. v11-0001-Pgbench-errors-use-the-RandomState-structure-for.patch - a patch for the RandomState structure (this is used to reset a client's random seed during the repeating of transactions after serialization/deadlock failures). Same

Does logical replication slot itself would be physically replicated to slaves?

2018-09-08 Thread Jinhua Luo
Hi All, My topology is as shown below: slave1 <--physical streaming protocol-master1 master2 -- physical streaming protocol ---> slave2 The master1 and slave1 are within DC1, while the others are within DC2. The logical streaming replication is

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2018-09-08 Thread Fabien COELHO
Hello Marina, v11-0003-Pgbench-errors-and-serialization-deadlock-retrie.patch - the main patch for handling client errors and repetition of transactions with serialization/deadlock failures (see the detailed description in the file). About patch v11-3. Patch applies cleanly on top of the

Re: StandbyAcquireAccessExclusiveLock doesn't necessarily

2018-09-08 Thread Simon Riggs
On 8 September 2018 at 00:37, Tom Lane wrote: > Commit 37c54863c removed the code in StandbyAcquireAccessExclusiveLock > that checked the return value of LockAcquireExtended. AFAICS this was > flat out wrong, because it's still passing reportMemoryError = false > to LockAcquireExtended, meaning