Re: psql - pager support - using invisible chars for signalling end of report

2020-04-24 Thread Pavel Stehule
so 25. 4. 2020 v 2:12 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > pá 24. 4. 2020 v 21:33 odesílatel Tom Lane napsal: > >> And what will happen when those characters are in the data? > > > It will be used on pager side as signal so previous rows was really last > > row of result, and

Using Valgrind to detect faulty buffer accesses (no pin or buffer content lock held)

2020-04-24 Thread Peter Geoghegan
I recently expressed an interest in using Valgrind memcheck to detect access to pages whose buffers do not have a pin held in the backend, or do not have a buffer lock held (the latter check makes sense for pages owned by index access methods). I came up with a quick and dirty patch, that I confirm

Re: Binary search in ScalarArrayOpExpr for OR'd constant arrays

2020-04-24 Thread James Coleman
On Fri, Apr 24, 2020 at 5:55 PM Tomas Vondra wrote: > > On Fri, Apr 24, 2020 at 09:38:54AM -0400, James Coleman wrote: > >On Thu, Apr 23, 2020 at 10:55 AM Tomas Vondra > > wrote: > >> > >> On Thu, Apr 23, 2020 at 09:02:26AM -0400, James Coleman wrote: > >> >On Thu, Apr 23, 2020 at 8:47 AM Tomas Vo

Re: Setting min/max TLS protocol in clientside libpq

2020-04-24 Thread Michael Paquier
On Fri, Apr 24, 2020 at 02:03:04PM +0200, Daniel Gustafsson wrote: > That was brought up by Michael in the thread, but none of us followed up on it > it seems. The current name was chosen to be consistent with the already > existing ssl* client-side settings, but I don't really have strong opinion

Re: psql - pager support - using invisible chars for signalling end of report

2020-04-24 Thread David G. Johnston
On Fri, Apr 24, 2020 at 5:12 PM Tom Lane wrote: > Pavel Stehule writes: > > pá 24. 4. 2020 v 21:33 odesílatel Tom Lane napsal: > >> And what will happen when those characters are in the data? > > > It will be used on pager side as signal so previous rows was really last > > row of result, and n

Re: psql - pager support - using invisible chars for signalling end of report

2020-04-24 Thread Tom Lane
Pavel Stehule writes: > pá 24. 4. 2020 v 21:33 odesílatel Tom Lane napsal: >> And what will happen when those characters are in the data? > It will be used on pager side as signal so previous rows was really last > row of result, and new row will be related to new result. In other words, it wil

Re: Incremental sorts and EXEC_FLAG_REWIND

2020-04-24 Thread Tomas Vondra
On Fri, Apr 24, 2020 at 04:35:02PM -0400, James Coleman wrote: On Sun, Apr 19, 2020 at 12:14 PM James Coleman wrote: On Wed, Apr 15, 2020 at 2:04 PM James Coleman wrote: > > On Wed, Apr 15, 2020 at 11:02 AM James Coleman wrote: > > > > On Tue, Apr 14, 2020 at 2:53 AM Michael Paquier wrote:

Re: Anybody want to check for Windows timezone updates?

2020-04-24 Thread Tom Lane
=?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?= writes: > Please find attached the output from Windows Server 2019. Thanks! That was a bit tedious --- I suppose it's not quite worth automating further, but I did make some effort to remove the cross-version formatting hazards in that table. C

Re: Binary search in ScalarArrayOpExpr for OR'd constant arrays

2020-04-24 Thread Tomas Vondra
On Fri, Apr 24, 2020 at 09:38:54AM -0400, James Coleman wrote: On Thu, Apr 23, 2020 at 10:55 AM Tomas Vondra wrote: On Thu, Apr 23, 2020 at 09:02:26AM -0400, James Coleman wrote: >On Thu, Apr 23, 2020 at 8:47 AM Tomas Vondra > wrote: >> >> On Mon, Apr 20, 2020 at 09:27:34PM -0400, James Colema

Re: psql - pager support - using invisible chars for signalling end of report

2020-04-24 Thread Pavel Stehule
pá 24. 4. 2020 v 21:33 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > I had a idea using some invisible chars, that are usually ignored (and > use > > these special characters only when user would it). > > And what will happen when those characters are in the data? > It will be used on

Re: Incremental sorts and EXEC_FLAG_REWIND

2020-04-24 Thread James Coleman
On Sun, Apr 19, 2020 at 12:14 PM James Coleman wrote: > > On Wed, Apr 15, 2020 at 2:04 PM James Coleman wrote: > > > > On Wed, Apr 15, 2020 at 11:02 AM James Coleman wrote: > > > > > > On Tue, Apr 14, 2020 at 2:53 AM Michael Paquier > > > wrote: > > > > > > > > Hi, > > > > > > > > When initial

Re: psql - pager support - using invisible chars for signalling end of report

2020-04-24 Thread Tom Lane
Pavel Stehule writes: > I had a idea using some invisible chars, that are usually ignored (and use > these special characters only when user would it). And what will happen when those characters are in the data? regards, tom lane

psql - pager support - using invisible chars for signalling end of report

2020-04-24 Thread Pavel Stehule
Hi Last release of pspg supports stream mode - it means so you can open psql in one terminal, redirect output to named pipe. In second terminal you can start pspg and read input from named pipe. Then you can see and edit SQL in one terminal, and you can see a result in second terminal. It is work

Re: Anybody want to check for Windows timezone updates?

2020-04-24 Thread Juan José Santamaría Flecha
On Fri, Apr 24, 2020 at 5:01 PM Tom Lane wrote: > > It's been some years since this was last done (a79a68562, looks like). > Anybody want to check if updates are needed? > Please find attached the output from Windows Server 2019. Regards, Juan José Santamaría Flecha win32tzlist.log Descripti

PostgreSQL 13 Beta 1 Release: 2020-05-21

2020-04-24 Thread Jonathan S. Katz
Hi, The PostgreSQL 13 Release Management Team is pleased to announce that the release date for PostgreSQL 13 Beta 1 is set to be 2020-05-21. The Open Items page is updated to reflect this. We’re excited to make the Beta available for testing and receive some early feedback around the latest major

Re: tar-related code in PostgreSQL

2020-04-24 Thread Tom Lane
Robert Haas writes: > We have similar code in many places -- because evidently nobody > thought it would be a good idea to have all the logic for reading and > writing tarfiles in a centralized location rather than having many > copies of it -- and typically it's written to pad the block out to a

tar-related code in PostgreSQL

2020-04-24 Thread Robert Haas
Hi, It has come to my attention that PostgreSQL has a bunch of code to read and write 'tar' archives and it's kind of a mess. Attached are two patches. The second one was written first, and does some modest cleanups, most notably replacing the use of the constants 512 and the formula (x + 511) & ~

Re: 2pc leaks fds

2020-04-24 Thread Alvaro Herrera
On 2020-Apr-24, Kyotaro Horiguchi wrote: > At Thu, 23 Apr 2020 19:16:03 -0400, Alvaro Herrera > wrote in > > Here's a first attempt at that. The segment_open/close callbacks are > > now given at XLogReaderAllocate time, and are passed the XLogReaderState > > pointer. I wrote a comment to exp

Anybody want to check for Windows timezone updates?

2020-04-24 Thread Tom Lane
src/timezone/README mentions When there has been a new release of Windows (probably including Service Packs), the list of matching timezones need to be updated. Run the script in src/tools/win32tzlist.pl on a Windows machine running this new release and apply any new timezones that it dete

Re: proposal - plpgsql - all plpgsql auto variables should be constant

2020-04-24 Thread Pavel Stehule
pá 24. 4. 2020 v 16:07 odesílatel Tom Lane napsal: > Ashutosh Bapat writes: > > On Fri, Apr 24, 2020 at 12:24 PM Pavel Stehule > wrote: > >> plpgsql generate lot of auto variables - FOUND, SQLERRM, cycle's > control variable, TG_WHEN, TG_OP, .. > >> Currently these variables are not protected,

Re: [PATCH'] Variables assigned with values that is never used.

2020-04-24 Thread Justin Pryzby
On Sat, Mar 28, 2020 at 10:33:23AM -0300, Ranier Vilela wrote: > Theses variables, are assigned with values that never is used and, can > safely have their values removed. I came across this one recently. commit ccf85a5512fe7cfd76c6586b67fe06d911428d34 Author: Justin Pryzby Date: Thu Apr 23 21

Re: Binary COPY IN size reduction

2020-04-24 Thread Tom Lane
=?UTF-8?Q?L=C5=91rinc_Pap?= writes: > We've switched recently from TEXT based COPY to the BINARY one. > We've noticed a slight performance increase, mostly because we don't need > to escape the content anymore. > Unfortunately the binary protocol's output ended up being slightly bigger > than the

Re: proposal - plpgsql - all plpgsql auto variables should be constant

2020-04-24 Thread Tom Lane
Ashutosh Bapat writes: > On Fri, Apr 24, 2020 at 12:24 PM Pavel Stehule > wrote: >> plpgsql generate lot of auto variables - FOUND, SQLERRM, cycle's control >> variable, TG_WHEN, TG_OP, .. >> Currently these variables are not protected, what can be source of problems, >> mainly for not experie

Re: Binary search in ScalarArrayOpExpr for OR'd constant arrays

2020-04-24 Thread James Coleman
On Thu, Apr 23, 2020 at 10:55 AM Tomas Vondra wrote: > > On Thu, Apr 23, 2020 at 09:02:26AM -0400, James Coleman wrote: > >On Thu, Apr 23, 2020 at 8:47 AM Tomas Vondra > > wrote: > >> > >> On Mon, Apr 20, 2020 at 09:27:34PM -0400, James Coleman wrote: > >> >Over in "execExprInterp() questions / Ho

Re: [Proposal] Global temporary tables

2020-04-24 Thread tushar
On 4/22/20 2:49 PM, 曾文旌 wrote: I provide the TRUNCATE tablename DROP to clear the data in the GTT and delete the storage files. This feature requires the current transaction to commit immediately after it finishes truncate. Thanks Wenjing , Please refer this scenario postgres=# create glob

Re: WIP: Aggregation push-down

2020-04-24 Thread Antonin Houska
Andy Fan wrote: > > 1) v14-0001-Introduce-RelInfoList-structure.patch > > - > > > > - I'm not entirely sure why we need this change. We had the list+hash > > before, so I assume we do this because we need the output functions? > > I believe

Re: WIP: Aggregation push-down

2020-04-24 Thread Antonin Houska
Andy Fan wrote: > The more tests on your patch, the more powerful I feel it is! Thanks for the appreciation. Given the poor progress it's increasingly hard for me to find motivation to work on it. I'll try to be more professional :-) > At the same time, I think the most difficult part to unders

Binary COPY IN size reduction

2020-04-24 Thread Lőrinc Pap
Hey, Our application sends millions of rows to the database every hour using the COPY IN protocol. We've switched recently from TEXT based COPY to the BINARY one. We've noticed a slight performance increase, mostly because we don't need to escape the content anymore. Unfortunately the binary prot

Re: backup manifests

2020-04-24 Thread Robert Haas
On Thu, Apr 23, 2020 at 5:16 PM Andres Freund wrote: > Do you not see a warning when compiling with optimizations enabled? No, I don't. I tried it with -O{0,1,2,3} and I always use -Wall -Werror. No warnings. [rhaas pgsql]$ clang -v clang version 5.0.2 (tags/RELEASE_502/final) Target: x86_64-app

Re: Setting min/max TLS protocol in clientside libpq

2020-04-24 Thread Daniel Gustafsson
> On 24 Apr 2020, at 12:56, Peter Eisentraut > wrote: > > Can we reconsider whether we really want to name the new settings like > "sslminprotocolversion", or whether we could add some underscores, both for > readability and for consistency with the server-side options? That was brought up by

Re: proposal - plpgsql - all plpgsql auto variables should be constant

2020-04-24 Thread Ashutosh Bapat
On Fri, Apr 24, 2020 at 12:24 PM Pavel Stehule wrote: > > Hi > > plpgsql generate lot of auto variables - FOUND, SQLERRM, cycle's control > variable, TG_WHEN, TG_OP, .. > > Currently these variables are not protected, what can be source of problems, > mainly for not experienced users. I propose

Re: Setting min/max TLS protocol in clientside libpq

2020-04-24 Thread Peter Eisentraut
Can we reconsider whether we really want to name the new settings like "sslminprotocolversion", or whether we could add some underscores, both for readability and for consistency with the server-side options? -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 2

Re: +(pg_lsn, int8) and -(pg_lsn, int8) operators

2020-04-24 Thread Jehan-Guillaume de Rorthais
On Fri, 24 Apr 2020 16:24:14 +0900 Michael Paquier wrote: > On Thu, Apr 23, 2020 at 08:09:22AM -0400, Robert Haas wrote: > > For anyone who missed it, this idea was popular on Twitter: > > > > https://twitter.com/fujii_masao/status/1252652020487487488 > > (For the sake of the archives) > To w

Re: Trying to pull up EXPR SubLinks

2020-04-24 Thread Andy Fan
On Fri, Apr 24, 2020 at 5:24 PM David Rowley wrote: > On Fri, 24 Apr 2020 at 15:26, Andy Fan wrote: > > > > Actually I have a different opinion to handle this issue, to execute the > > a > (select avg(a) from tinner where x = touer.x); The drawback of > current > > path is because it may calcu

Re: Trying to pull up EXPR SubLinks

2020-04-24 Thread David Rowley
On Fri, 24 Apr 2020 at 15:26, Andy Fan wrote: > > Actually I have a different opinion to handle this issue, to execute the > a > (select avg(a) from tinner where x = touer.x); The drawback of current > path is because it may calculates the same touer.x value multi-times. So > if we cache the val

Re: Trying to pull up EXPR SubLinks

2020-04-24 Thread Dilip Kumar
On Fri, Apr 24, 2020 at 2:42 PM Andy Fan wrote: >> >> >> > 3. I added the material path in a very hacked way, the if check just to >> > make >> > sure it take effect on my test statement only. If you want to test this >> > patch locally, >> > you need to change the oid for your case. >> > >>

Re: Trying to pull up EXPR SubLinks

2020-04-24 Thread Andy Fan
> > > > 3. I added the material path in a very hacked way, the if check just > to make > > sure it take effect on my test statement only. If you want to test this > patch locally, > > you need to change the oid for your case. > > > > + if (linitial_node(RangeTblEntry, root->parse->rtable)-

Re: PG compilation error with Visual Studio 2015/2017/2019

2020-04-24 Thread Juan José Santamaría Flecha
On Fri, Apr 24, 2020 at 7:47 AM davinder singh wrote: > On Thu, Apr 23, 2020 at 6:49 PM Juan José Santamaría Flecha < > juanjo.santama...@gmail.com> wrote: > >> On Thu, Apr 23, 2020 at 3:00 PM Amit Kapila >> wrote: >> >>> >>> Thanks, I will verify these. BTW, have you done something special to

Re: Trying to pull up EXPR SubLinks

2020-04-24 Thread Dilip Kumar
On Fri, Apr 24, 2020 at 8:56 AM Andy Fan wrote: > > Actually I have a different opinion to handle this issue, to execute the > a > (select avg(a) from tinner where x = touer.x); The drawback of current > path is because it may calculates the same touer.x value multi-times. So > if we cache the v

Re: Parallel Append can break run-time partition pruning

2020-04-24 Thread Amit Langote
On Thu, Apr 23, 2020 at 7:37 PM David Rowley wrote: > On Thu, 23 Apr 2020 at 02:37, Amit Langote wrote: > > Regarding the patch, I had been assuming that the "pa" in > > pa_subpaths_valid stands for "parallel append", so it using the > > variable as is in the new code structure would be misleadin

Re: Add support for automatically updating Unicode derived files

2020-04-24 Thread Peter Eisentraut
I have committed the first Unicode data update using this new "make update-unicode" facility. CLDR is released regularly every 6 months, so around this time every year would be the appropriate time to pull in the latest updates in preparation for our own release. -- Peter Eisentraut

Re: [Proposal] Global temporary tables

2020-04-24 Thread Prabhat Sahu
Hi Wenjing, With the new patch(v30) as you mentioned the new syntax support for "TRUNCATE TABLE gtt DROP", but we also observe the syntax "DROP TABLE gtt DROP" is working as below: postgres=# create global temporary table gtt(c1 int) on commit preserve rows; CREATE TABLE postgres=# DROP TABLE gtt

Re: +(pg_lsn, int8) and -(pg_lsn, int8) operators

2020-04-24 Thread Michael Paquier
On Thu, Apr 23, 2020 at 08:09:22AM -0400, Robert Haas wrote: > For anyone who missed it, this idea was popular on Twitter: > > https://twitter.com/fujii_masao/status/1252652020487487488 (For the sake of the archives) To which Alvaro, Robert, Fabrízio de Royes Mello, Julien Rouhaud and I answered

Re: HEAPDEBUGALL is broken

2020-04-24 Thread Michael Paquier
On Wed, Apr 22, 2020 at 08:44:18PM -0700, Andres Freund wrote: > On 2020-04-19 09:37:08 -0400, Tom Lane wrote: >> +1 for removing both. There are a lot of such debug "features" >> in the code, and few of them are worth anything IME. > > Belatedly: +many +1. -- Michael signature.asc Description