Re: utilities to rebuild commit logs from wal

2018-06-23 Thread Bruce Momjian
On Fri, Jun 22, 2018 at 10:49:58AM +0200, Chris Travers wrote: > Before we reinvent the wheel here, does anyone know of utilities to build > commit logs from wal segments?  Or even to just fill with commits? > > I figure it is worth asking before I write one. Uh, what are commit log? pg_waldump

Re: Incorrect errno used with %m for backend code

2018-06-23 Thread Ashutosh Sharma
On Sat, Jun 23, 2018 at 6:43 PM, Michael Paquier wrote: > On Fri, Jun 22, 2018 at 03:45:33PM +0530, Ashutosh Sharma wrote: >> Okay, thanks for the confirmation. Few of them are also there in >> origin.c and snapbuild.c files. > > Thanks Ashutosh. I have been reviewing the whole tree and I found m

Re: Keeping temporary tables in shared buffers

2018-06-23 Thread Bruce Momjian
On Thu, Jun 21, 2018 at 07:42:54AM +0530, Amit Kapila wrote: > On Wed, Jun 20, 2018 at 8:47 PM, Bruce Momjian wrote: > > On Sat, Jun 2, 2018 at 05:18:17PM -0400, Asim Praveen wrote: > >> Hi Amit > >> > >> On Mon, May 28, 2018 at 4:25 AM, Amit Kapila > >> wrote: > >> > > >> > This is one way, bu

Re: comma to delimit fractional seconds

2018-06-23 Thread Tom Lane
Chris Howard writes: > I looked at the TODO list and saw the issue of using comma to delimit > fractional seconds. ... > Is there anything more to it than allowing HH:MM:SS,### as well as > HH:MM:SS.# ? Here's the thing: most of the easy-looking stuff on the TODO list is there because t

Re: pg_upgrade from 9.4 to 10.4

2018-06-23 Thread Bruce Momjian
On Fri, Jun 15, 2018 at 03:01:37PM -0700, Vimalraj A wrote: > Hi, > > After pg_upgrade, the data in Postgres is corrupted.  > > 1. Postgres 9.4, stop db with "immediate" mode > 2. Run pg_upgrade, to upgrade to Postgres 10.4 > 3. Start Postgres 10 and run vacuum full, got a bunch of "concurrent in

Re: WIP: BRIN multi-range indexes

2018-06-23 Thread Tomas Vondra
Hi, Attached is rebased version of this BRIN patch series, fixing mostly the breakage due to 372728b0 (aka initial-catalog-data format changes). As 2018-07 CF is meant for almost-ready patches, this is more a 2018-09 material. But perhaps someone would like to take a look - and I'd have to fix it

Re: [GSoC] array processing questions

2018-06-23 Thread Charles Cui
thanks Andrew, will take a look. On Sat, Jun 23, 2018, 5:44 PM Andrew Gierth wrote: > > "Charles" == Charles Cui writes: > > Charles> Hi mentors and hackers, > Charles> One question about array processing in postgresql. Assume > Charles> my input is a Datum (which contains an array).

Re: [GSoC] array processing questions

2018-06-23 Thread Andrew Gierth
> "Charles" == Charles Cui writes: Charles> Hi mentors and hackers, Charles> One question about array processing in postgresql. Assume Charles> my input is a Datum (which contains an array). Are there any Charles> examples to loop through the array and operates on each Charles> eleme

[GSoC] working status

2018-06-23 Thread Charles Cui
Hi mentors and hackers, Here is my current working status. Resolved all warnings found by Aleksander previously. Having two threads in parallel. One is the thrift binary type implementation, the other is thrift compact byte interface implementation. For these two threads, simple data type has b

Re: pg11b1 from outside a txn: "VACUUM cannot run inside a transaction block": should be: ...or multi-command string

2018-06-23 Thread Andrew Gierth
> "Justin" == Justin Pryzby writes: Justin> I couldn't figure out how to \set VERBOSITY verbose inside a Justin> psql command (??), psql -v VERBOSITY=verbose -c 'query here' -- Andrew (irc:RhodiumToad)

[GSoC] array processing questions

2018-06-23 Thread Charles Cui
Hi mentors and hackers, One question about array processing in postgresql. Assume my input is a Datum (which contains an array). Are there any examples to loop through the array and operates on each element? feel like it is not that straight-ford. Thanks Charles

pg11b1 from outside a txn: "VACUUM cannot run inside a transaction block": should be: ...or multi-command string

2018-06-23 Thread Justin Pryzby
in pg10: ts=# begin;VACUUM FULL pg_toast.pg_toast_2619; BEGIN ERROR: 25001: VACUUM cannot run inside a transaction block LOCATION: PreventTransactionChain, xact.c:3167 => sounds fine $ psql postgres -c 'SELECT 1; VACUUM pg_statistic' ERROR: VACUU

Re: Does logical replication supports cross platform servers?

2018-06-23 Thread Bruce Momjian
On Wed, Jun 13, 2018 at 11:42:14AM +1000, Haribabu Kommi wrote: > > On Tue, Jun 12, 2018 at 1:29 PM Craig Ringer wrote: > > On 12 June 2018 at 11:04, Haribabu Kommi wrote: > > Hi All, > > I am not able to find any docs suggesting that PostgreSQL logical > replicati

Re: Log query parameters for terminated execute

2018-06-23 Thread Pavel Stehule
2018-06-23 21:54 GMT+02:00 Sergei Kornilov : > Hello all > We already have feature to logging query parameters. If we use > log_statement = 'all' we write parameters before execution and all is fine > here. If we use log_min_duration_statement statement is logged obviously > after execution, but c

Retrieve memory size allocated by libpq

2018-06-23 Thread Lars Kanis
Hello, I would like to be able to retrieve the size of memory internally allocated by libpq for a result. The reason is that we have a Ruby wrapper that exposes libpq in Ruby. The problem is that Ruby's GC doesn't know how much memory has been allocated by libpq, so no pressure is applied to the G

Log query parameters for terminated execute

2018-06-23 Thread Sergei Kornilov
Hello all We already have feature to logging query parameters. If we use log_statement = 'all' we write parameters before execution and all is fine here. If we use log_min_duration_statement statement is logged obviously after execution, but currently we have no parameters if query was terminate

comma to delimit fractional seconds

2018-06-23 Thread Chris Howard
I'm new at this. I looked at the TODO list and saw the issue of using comma to delimit fractional seconds. I looked at the parser stuff and I think I have at least a start on the issue. Is there anything more to it than allowing HH:MM:SS,### as well as HH:MM:SS.# ? Is it OK if

postgresql_fdw doesn't handle defaults correctly

2018-06-23 Thread Pavel Stehule
Hi I have a table boo create table boo(id serial primary key, inserted date default current_date, v varchar); I imported this table via simple IMPORT FOREIGN SCHEMA public FROM SERVER foreign_server INTO public; The command insert into boo(v) values('ahoj'); is working in original database, b

Re: Constraint documentation

2018-06-23 Thread Fabien COELHO
Hello lætitia, My 0.02 € to try to simplify the suggested documentation. Check constraint were not are not designed to enforce business rules across tables. Avoid using check constraints with function accessing to other tables accessing other tables (no "to") and prefer triggers inst

Re: Adding Markodwn formatting to psql output

2018-06-23 Thread Vik Fearing
On 23/06/18 17:01, Alvaro Herrera wrote: > On 2018-Jun-23, Bruce Momjian wrote: > >> On Tue, May 29, 2018 at 06:47:54PM +0200, Lætitia Avrot wrote: >>> >>> I will try to apply and review the patch. >> >> Uh, no one mentioned in this thread that psql has supported asciidoc >> since PG 9.5. > > I w

Re: Incorrect visibility test function assigned to snapshot

2018-06-23 Thread Bruce Momjian
On Wed, May 30, 2018 at 09:28:54AM -0400, Alvaro Herrera wrote: > On 2018-May-30, Antonin Houska wrote: > > > In the header comment, SnapBuildInitialSnapshot() claims to set > > snapshot->satisfies to the HeapTupleSatisfiesMVCC test function, and indeed > > it > > converts the "xid" array to matc

Re: Supporting tls-server-end-point as SCRAM channel binding for OpenSSL 1.0.0 and 1.0.1

2018-06-23 Thread Bruce Momjian
On Wed, Jun 6, 2018 at 01:16:11PM -0700, Steven Fackler wrote: > TLS 1.3, (which is currently in a draft state, but is theoretically being > finalized soon) does not support the TLS channel binding algorithms [1]. From Uh, according to this article, TLS 1.3 was finalized in March: https://www

Re: Adding Markodwn formatting to psql output

2018-06-23 Thread Alvaro Herrera
On 2018-Jun-23, Bruce Momjian wrote: > On Tue, May 29, 2018 at 06:47:54PM +0200, Lætitia Avrot wrote: > > > > > > Le mar. 29 mai 2018 à 17:28, Euler Taveira a écrit : > > > > 2018-05-29 12:11 GMT-03:00 Lætitia Avrot : > > > I write often documents for my customers in MarkDown to produc

Re: Concurrency bug in UPDATE of partition-key

2018-06-23 Thread Alvaro Herrera
Would you wait a little bit before pushing this? I'd like to give this a read too. Thanks -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: Adding Markodwn formatting to psql output

2018-06-23 Thread Bruce Momjian
On Tue, May 29, 2018 at 06:47:54PM +0200, Lætitia Avrot wrote: > > > Le mar. 29 mai 2018 à 17:28, Euler Taveira a écrit : > > 2018-05-29 12:11 GMT-03:00 Lætitia Avrot : > > I write often documents for my customers in MarkDown to produce pdf > > documents. Quite often, I need to pres

Re: SCRAM with channel binding downgrade attack

2018-06-23 Thread Bruce Momjian
On Sat, Jun 23, 2018 at 10:30:19PM +0900, Michael Paquier wrote: > On Fri, Jun 22, 2018 at 11:01:53PM -0400, Bruce Momjian wrote: > > Uh, as I am understanding it, if we don't allow clients to force channel > > binding, then channel binding is useless because it cannot prevent > > man-in-the-middle

Re: SCRAM with channel binding downgrade attack

2018-06-23 Thread Michael Paquier
On Fri, Jun 22, 2018 at 11:01:53PM -0400, Bruce Momjian wrote: > Uh, as I am understanding it, if we don't allow clients to force channel > binding, then channel binding is useless because it cannot prevent > man-in-the-middle attacks. I am sure some users will try to use it, and > not understand

Re: Incorrect errno used with %m for backend code

2018-06-23 Thread Michael Paquier
On Fri, Jun 22, 2018 at 11:15:53AM -0400, Alvaro Herrera wrote: > I wondered for a bit if it would be a better idea to have > CloseTransientFile restore the existing errno if there is any and close > works fine -- when I noticed that that function itself says that caller > should check errno for cl

Re: Incorrect errno used with %m for backend code

2018-06-23 Thread Michael Paquier
On Fri, Jun 22, 2018 at 03:45:33PM +0530, Ashutosh Sharma wrote: > Okay, thanks for the confirmation. Few of them are also there in > origin.c and snapbuild.c files. Thanks Ashutosh. I have been reviewing the whole tree and I found more places where this is missing, like rewriteheap.c, reorderbuf

Re: PATCH: backtraces for error messages

2018-06-23 Thread Craig Ringer
On 23 June 2018 at 20:22, Craig Ringer wrote: > Yeah. libunwind doesn't expose any interface to get that information, so > you'd have to use platform APIs, like glibc's dl_iterate_phdr or dladdr, or > capture /proc/self/maps. > Ahem, I take that part back. https://stackoverflow.com/a/21584356/

Re: PATCH: backtraces for error messages

2018-06-23 Thread Craig Ringer
On 22 June 2018 at 23:26, Korry Douglas wrote: > A few misc comments: > > In general, +1. > > It might be nice to move the stack trace code into a separate function > (not static to elog.c) - I have often found it useful to attach backtraces > to objects so I can debug complex allocation/dealloca

Re: libpq compression

2018-06-23 Thread Konstantin Knizhnik
On 22.06.2018 20:56, Robbie Harwood wrote: Konstantin Knizhnik writes: On 22.06.2018 18:59, Robbie Harwood wrote: Konstantin Knizhnik writes: On 21.06.2018 20:14, Robbie Harwood wrote: Konstantin Knizhnik writes: On 21.06.2018 17:56, Robbie Harwood wrote: Konstantin Knizhnik writes:

Re: Keeping temporary tables in shared buffers

2018-06-23 Thread Amit Kapila
On Fri, Jun 22, 2018 at 6:09 PM, Robert Haas wrote: > On Mon, May 28, 2018 at 4:25 AM, Amit Kapila wrote: >> On Fri, May 25, 2018 at 6:33 AM, Asim Praveen wrote: >>> We are evaluating the use of shared buffers for temporary tables. The >>> advantage being queries involving temporary tables can

Re: Concurrency bug in UPDATE of partition-key

2018-06-23 Thread Amit Kapila
On Fri, Jun 22, 2018 at 10:25 PM, Amit Khandekar wrote: > On 20 June 2018 at 18:54, Amit Kapila wrote: >> On Tue, Jun 19, 2018 at 9:33 PM, Amit Khandekar >> wrote: >> >> 2. >> ExecBRDeleteTriggers(..) >> { >> .. >> + /* If requested, pass back the concurrently updated tuple, if any. */ >> + if