Re: Fix of fake unlogged LSN initialization

2019-10-26 Thread Dilip Kumar
On Fri, Oct 25, 2019 at 7:42 AM tsunakawa.ta...@fujitsu.com wrote: > > From: Dilip Kumar > > I have noticed that in StartupXlog also we reset it with 1, you might > > want to fix that as well? > > > > StartupXLOG > > { > > ... > > /* > > * Initialize unlogged LSN. On a clean shutdown, it's restor

Re: Fix of fake unlogged LSN initialization

2019-10-26 Thread Michael Paquier
On Fri, Oct 25, 2019 at 02:11:55AM +, tsunakawa.ta...@fujitsu.com wrote: > Thanks for taking a look. I'm afraid my patch includes the fix for this part. Yes. And now this is applied and back-patched. -- Michael signature.asc Description: PGP signature

Re: Proposal: Add more compile-time asserts to expose inconsistencies.

2019-10-26 Thread Andres Freund
Hi, On October 26, 2019 6:06:07 AM PDT, Peter Eisentraut wrote: >On 2019-10-10 00:52, Smith, Peter wrote: >> I liked your idea of using an extern function declaration for >implementing the file-scope compile-time asserts. AFAIK it is valid >standard C. >> >> Thank you for the useful link to th

Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'

2019-10-26 Thread Andres Freund
Hi, On October 26, 2019 4:09:29 PM PDT, Vik Fearing wrote: >On 26/10/2019 17:41, Eugen Konkov wrote: >> Hi. >> >> I have noticed that it would be cool to use '==' in place of 'IS >NOT >> DISTICT FROM' >> >> What do you think about this crazy idea? > > >I think this is a terrible idea.  The on

Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'

2019-10-26 Thread Vik Fearing
On 26/10/2019 17:41, Eugen Konkov wrote: > Hi. > > I have noticed that it would be cool to use '==' in place of 'IS NOT > DISTICT FROM' > > What do you think about this crazy idea? I think this is a terrible idea.  The only reason to do this would be to index it, but indexes (btree at least) ex

Re: pg_dump compatibility level / use create view instead of create table/rule

2019-10-26 Thread Tom Lane
Andres Freund writes: > On 2019-10-10 11:20:14 -0400, Tom Lane wrote: >> The reason we get "REPLICA IDENTITY NOTHING" is that a view's relreplident >> is set to 'n' not 'd', which might not have been a great choice. > Hm, yea. I wonder if we should add a REPLICA_IDENTITY_INVALID or such, > for no

Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'

2019-10-26 Thread Tom Lane
Andres Freund writes: > On 2019-10-26 14:23:49 -0400, Tom Lane wrote: >> ... instead of >> x IS NOT DISTINCT FROM y >> I'm vaguely imagining >> x = {magic} y >> where unlike Eugen's suggestion, "=" is the real name of the underlying >> comparison operator. For dump/restore this could be

Re: pg_dump compatibility level / use create view instead of create table/rule

2019-10-26 Thread Andres Freund
Hi, On 2019-10-10 11:20:14 -0400, Tom Lane wrote: > regression=# create table mytab (f1 int primary key, f2 text); > CREATE TABLE > regression=# create view myview as select * from mytab group by f1; > CREATE VIEW > > This situation is problematic for pg_dump because validity of the > view depend

Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'

2019-10-26 Thread Andres Freund
Hi, On 2019-10-26 14:23:49 -0400, Tom Lane wrote: > I wrote: > > We do have some unresolved issues around how to let dump/restore > > control the interpretation of IS [NOT] DISTINCT FROM, cf > > https://www.postgresql.org/message-id/flat/ffefc172-a487-aa87-a0e7-472bf29735c8%40gmail.com > > but I d

Re: define bool in pgtypeslib_extern.h

2019-10-26 Thread Tom Lane
Andrew Gierth writes: > "Tom" == Tom Lane writes: > Tom> I'm inclined to think that we need to make ecpglib.h's > Tom> bool-related definitions exactly match c.h, > I'm wondering whether we should actually go the opposite way and say > that c.h's "bool" definition should be backend only, and t

Re: define bool in pgtypeslib_extern.h

2019-10-26 Thread Andrew Gierth
> "Tom" == Tom Lane writes: Tom> On closer inspection, it seems to be just blind luck. For example, Tom> if I rearrange the inclusion order in a file using ecpglib.h: Ugh. Tom> I'm inclined to think that we need to make ecpglib.h's Tom> bool-related definitions exactly match c.h, I'm w

Re: pg_dump compatibility level / use create view instead of create table/rule

2019-10-26 Thread Tom Lane
I wrote: > Alex Williams writes: >> [ gripes about pg_dump printing REPLICA IDENTITY NOTHING for a view ] > This is fixed in v10 and up thanks to d8c05aff5. I was hesitant to > back-patch that at the time, but now that it's survived in the field > for a couple years, I think a good case could be

Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'

2019-10-26 Thread Tom Lane
I wrote: > We do have some unresolved issues around how to let dump/restore > control the interpretation of IS [NOT] DISTINCT FROM, cf > https://www.postgresql.org/message-id/flat/ffefc172-a487-aa87-a0e7-472bf29735c8%40gmail.com > but I don't think this idea is helping with that at all. BTW, takin

Re: vacuum on table1 skips rows because of a query on table2

2019-10-26 Thread Virender Singla
If long-running transaction is "read committed", then we are sure that any new query coming (even on same table1 as vacuum table) will need snapshot on point of time query start and not the time transaction starts (but still why read committed transaction on table2 cause vacuum on table1 to skip

Re: define bool in pgtypeslib_extern.h

2019-10-26 Thread Tom Lane
Amit Kapila writes: > On Fri, Oct 25, 2019 at 9:55 PM Tom Lane wrote: >> However, we're not out of the woods, because lookee here in >> ecpglib.h: >> #ifndef bool >> #define bool char >> #endif /* ndef bool */ >> I'm more than slightly surprised that we haven't already se

Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'

2019-10-26 Thread Jonah H. Harris
On Sat, Oct 26, 2019 at 12:49 PM Tom Lane wrote: > David Fetter writes: > > On Sat, Oct 26, 2019 at 06:41:10PM +0300, Eugen Konkov wrote: > >> I have noticed that it would be cool to use '==' in place of 'IS NOT > >> DISTICT FROM' > >> What do you think about this crazy idea? > > > Turning "IS

Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'

2019-10-26 Thread Tom Lane
David Fetter writes: > On Sat, Oct 26, 2019 at 06:41:10PM +0300, Eugen Konkov wrote: >> I have noticed that it would be cool to use '==' in place of 'IS NOT >> DISTICT FROM' >> What do you think about this crazy idea? > Turning "IS NOT DISTINCT FROM" into an operator sounds like a great > idea.

Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'

2019-10-26 Thread David Fetter
On Sat, Oct 26, 2019 at 06:41:10PM +0300, Eugen Konkov wrote: > Hi. > > I have noticed that it would be cool to use '==' in place of 'IS NOT > DISTICT FROM' > > What do you think about this crazy idea? Turning "IS NOT DISTINCT FROM" into an operator sounds like a great idea. Let the name bike-

Re: fairywren failures

2019-10-26 Thread Andrew Dunstan
On 10/25/19 3:09 PM, Peter Eisentraut wrote: > On 2019-10-16 13:34, Andrew Dunstan wrote: >>> Could you please check how this animal is labeled? AFAICT, this is not >>> an msys2 build but a mingw build (x86_64-w64-mingw32). >> It is indeed an msys2 system. However, when we set MSYSTEM=MINGW64 a

Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'

2019-10-26 Thread Eugen Konkov
Hi. I have noticed that it would be cool to use '==' in place of 'IS NOT DISTICT FROM' What do you think about this crazy idea? -- Best regards, Eugen Konkov

Re: Proposal: Add more compile-time asserts to expose inconsistencies.

2019-10-26 Thread Peter Eisentraut
On 2019-10-10 00:52, Smith, Peter wrote: > I liked your idea of using an extern function declaration for implementing > the file-scope compile-time asserts. AFAIK it is valid standard C. > > Thank you for the useful link to that compiler explorer. I tried many > scenarios of the new StaticAssert

Re: errbacktrace

2019-10-26 Thread Peter Eisentraut
On 2019-09-30 20:16, Peter Eisentraut wrote: > On 2019-09-27 17:50, Alvaro Herrera wrote: >> On 2019-Sep-13, Alvaro Herrera wrote: >> >>> On 2019-Aug-20, Peter Eisentraut wrote: >>> The memory management of that seems too complicated. The "extra" mechanism of the check/assign hooks only

Restore replication settings when modifying a field type

2019-10-26 Thread Quan Zongliang
When the user modifies the REPLICA IDENTIFY field type, the logical replication settings are lost. For example: postgres=# \d+ t1 Table "public.t1" Column | Type | Collation | Nullable | Default | Storage | Stats target | Description +

Re: MinGW compiler warnings in ecpg tests

2019-10-26 Thread Michael Meskes
> These files don't use our printf replacement or the c.h porting > layer, > so unless we want to start doing that, I propose the attached patch > to > determine the appropriate format conversion the hard way. I don't think such porting efforts are worth it for a single test case, or in other word

Cleanup - Removal of apply_typmod function in #if 0

2019-10-26 Thread vignesh C
Hi, One of the function apply_typmod in numeric.c file present within #if 0. This is like this for many years. I felt this can be removed. Attached patch contains the changes to handle removal of apply_typmod present in #if 0. Thoughts? Regards, Vignesh EnterpriseDB: http://www.enterprisedb.com

Re: TOAST corruption in standby database

2019-10-26 Thread Amit Kapila
On Fri, Oct 25, 2019 at 1:50 AM Alex Adriaanse wrote: > > Standby (corrupted): > > # dd if=data/base/18034/16103928.13 bs=8192 skip=89185 count=1 status=none | > hexdump -C | head -8 > a3 0e 00 00 48 46 88 0e 00 00 05 00 30 00 58 0f |HF..0.X.| > 0010 00 20 04 20 00 00 00