Re: Upgrading pg_statistic to handle collation honestly

2018-12-12 Thread Peter Eisentraut
On 12/12/2018 16:57, Tom Lane wrote: > Attached is a draft patch for same. It adds storage to pg_statistic > to record the collation of each statistics "slot". A plausible > alternative design would be to just say "look at the collation of the > underlying column", but that would require extra

Re: COPY FROM WHEN condition

2018-12-12 Thread Surafel Temesgen
On Wed, Dec 12, 2018 at 9:28 PM Tomas Vondra wrote: > > Can you also update the docs to mention that the functions called from > the WHERE clause does not see effects of the COPY itself? > > *Of course, i also add same comment to insertion method selection* *regards * *Surafel* diff --git

Re: Introducing SNI in TLS handshake for SSL connections

2018-12-12 Thread Pablo Iranzo Gómez
Hi Andreas +++ Andreas Karlsson [13/12/18 01:30 +0100]: On 12/11/18 3:52 PM, Pablo Iranzo Gómez wrote: I came to this old thread while trying to figure out on how to setup postgres replication behind OpenShift/Kubernetes behind a route (which only forwards 80 or 443 traffic), but could work

Re: pg_partition_tree crashes for a non-defined relation

2018-12-12 Thread Amit Langote
On 2018/12/12 9:52, Michael Paquier wrote: > On Mon, Dec 10, 2018 at 10:52:37PM +0900, Michael Paquier wrote: >> OK. Sure, let's do as you suggest then. I'll wait a couple of days >> before committing the patch so as if someone has extra comments they >> have the time to post. So please feel

Re: Pluggable Storage - Andres's take

2018-12-12 Thread Kyotaro HORIGUCHI
Hello. At Tue, 27 Nov 2018 14:58:35 +0900, Amit Langote wrote in <080ce65e-7b96-adbf-1c8c-7c88d87ea...@lab.ntt.co.jp> > + > + > +TupleTableSlotOps * > +slot_callbacks (Relation relation); > + > + API to access the slot specific methods; > + Following methods are available; > +

Re: Pluggable Storage - Andres's take

2018-12-12 Thread Kyotaro HORIGUCHI
Hello. (in the next branch:) At Tue, 27 Nov 2018 14:58:35 +0900, Amit Langote wrote in <080ce65e-7b96-adbf-1c8c-7c88d87ea...@lab.ntt.co.jp> > Thank you for working on this. Really looking forward to how this shapes > up. :) +1. I looked through the documentation part, as where I can do

Re: Cache lookup errors with functions manipulation object addresses

2018-12-12 Thread Michael Paquier
On Wed, Dec 12, 2018 at 02:21:29PM -0300, Alvaro Herrera wrote: > I think defining bit flags in an enum is weird; I'd use defines > instead. Okay, I am fine with that. > And (a purely stylistic point) I'd use bits32 rather than uint32. (I'm > probably alone in this opinion, since almost every

Re: gist microvacuum doesn't appear to care about hot standby?

2018-12-12 Thread Alexander Korotkov
On Thu, Dec 13, 2018 at 1:45 AM Andres Freund wrote: > Is there any reason something like that isn't necessary for gist? If so, > where's that documented? If not, uh, isn't that a somewhat serious bug > in gist? Thank you for pointing! This looks like a bug for me too. I'm going to investigate

Re: Making WAL receiver startup rely on GUC context for primary_conninfo and primary_slot_name

2018-12-12 Thread Michael Paquier
On Wed, Dec 12, 2018 at 02:55:17PM +0900, Michael Paquier wrote: > Well, the conninfo and slot name accessible to the user are the values > available only once the information of the WAL receiver in shared memory > is ready to be displayed. Relying more on the GUC context has the > advantage to

Re: Introducing SNI in TLS handshake for SSL connections

2018-12-12 Thread Andreas Karlsson
On 12/11/18 3:52 PM, Pablo Iranzo Gómez wrote: I came to this old thread while trying to figure out on how to setup postgres replication behind OpenShift/Kubernetes behind a route (which only forwards 80 or 443 traffic), but could work if SNI is supported on the client using it. Hm ... while

Re: Add timeline to partial WAL segments

2018-12-12 Thread Michael Paquier
On Wed, Dec 12, 2018 at 07:54:05AM -0500, David Steele wrote: > The LSN switch point is often the same even when servers are going to > different timelines. If the LSN is different enough then the problem > solves itself since the .partial will be on an entirely different > segment. That would

Re: Making WAL receiver startup rely on GUC context for primary_conninfo and primary_slot_name

2018-12-12 Thread Michael Paquier
On Wed, Dec 12, 2018 at 06:55:04PM +0300, Sergei Kornilov wrote: >> This allows the state of walrcv and startup to diverge, they could >> e.g. have different configuration, due to differently time config >> reloads. > > So we have exactly same problem with, for example, hot_standby_feedback, >

Re: Remove Deprecated Exclusive Backup Mode

2018-12-12 Thread Michael Paquier
On Wed, Dec 12, 2018 at 08:22:10AM -0500, David Steele wrote: > Add the fact that we have *zero* tests for exclusive backups. I only > had to refactor one exclusive backup in the tests and since it did not > archive, exclude pg_wal, postmaster.pid, or do anything else our docs > recommend I

gist microvacuum doesn't appear to care about hot standby?

2018-12-12 Thread Andres Freund
Hi, Am I missing something or did commit 013ebc0a7b7ea9c1b1ab7a3d4dd75ea121ea8ba7 Author: Teodor Sigaev Date: 2015-09-09 18:43:37 +0300 Microvacuum for GIST Mark index tuple as dead if it's pointed by kill_prior_tuple during ordinary (search) scan and remove it during insert

Re: WIP: Avoid creation of the free space map for small tables

2018-12-12 Thread John Naylor
On 11/24/18, Amit Kapila wrote: > 4. You have mentioned above that "system catalogs created during > bootstrap still have a FSM if they have any data." and I can also see > this behavior, have you investigated this point further? I found the cause of this. There is some special-case code in md.c

Log a sample of transactions

2018-12-12 Thread Adrien Nayrat
Hello, Per idea of Nikolay Samokhvalov[1] I propose this patch to add the possibility to log all statements from a fraction of transactions. I have several questions: * Do we want this feature? * How can I add tests? I seems hard to handle tests when a there is duration in the output. *

Re: Introducing SNI in TLS handshake for SSL connections

2018-12-12 Thread Pablo Iranzo Gómez
+++ Andreas Karlsson [11/12/18 18:18 +0100]: On 12/11/18 3:52 PM, Pablo Iranzo Gómez wrote:> I came to this old thread while trying to figure out on how to setup postgres replication behind OpenShift/Kubernetes behind a route (which only forwards 80 or 443 traffic), but could work if SNI is

Minimal logical decoding on standbys

2018-12-12 Thread Andres Freund
Hi, Craig previously worked on $subject, see thread [1]. A bunch of the prerequisite features from that and other related threads have been integrated into PG. What's missing is actually allowing logical decoding on a standby. The latest patch from that thread does that [2], but unfortunately

Bogus EPQ plan construction in postgres_fdw

2018-12-12 Thread Tom Lane
By chance I noticed that postgres_fdw's postgresGetForeignPlan() assumes --- without any checking --- that the outer_plan it's given for a join relation must have a NestLoop, MergeJoin, or HashJoin node at the top. That's been wrong at least since commit 4bbf6edfb (which could cause insertion of a

Re: COPY FROM WHEN condition

2018-12-12 Thread Tomas Vondra
On 12/12/18 7:05 AM, Surafel Temesgen wrote: > > > On Tue, Dec 4, 2018 at 12:44 PM Alvaro Herrera > wrote: > > After reading this thread, I think I like WHERE better than FILTER. > Tally: > > WHERE: Adam Berlin, Lim Myungkyu, Dean Rasheed, yours

Re: Reorganize collation lookup time and place

2018-12-12 Thread Andres Freund
Hi, On 2018-12-10 16:12:54 +0100, Peter Eisentraut wrote: > Attached is a patch that reorganizes how and where collations are looked up. > > Until now, a fmgr C function that makes use of collation information > (for example varstr_cmp(), str_toupper()) gets passed the collation OID, > looks up

Re: [HACKERS] Can ICU be used for a database's default sort order?

2018-12-12 Thread Peter Eisentraut
On 12/12/2018 15:57, Daniel Verite wrote: > I think one related issue that the patch works around by using a libc locale > as a proxy is knowing what to put into libc's LC_CTYPE and LC_COLLATE. > In fact I've been wondering if that's the main reason for the interface > implemented by the patch.

Re: Cache lookup errors with functions manipulation object addresses

2018-12-12 Thread Alvaro Herrera
On 2018-Sep-18, Michael Paquier wrote: > On Fri, Sep 14, 2018 at 12:07:23PM -0300, Alvaro Herrera wrote: > > On 2018-Sep-14, Alvaro Herrera wrote: > >> I haven't looked at 0003 yet. > > Thanks for the review. I have pushed 0002 for now. I had one doubt > about 0001 though. So as to avoid

Upgrading pg_statistic to handle collation honestly

2018-12-12 Thread Tom Lane
When we first put in collations support, we basically punted on teaching ANALYZE, pg_statistic, and the planner selectivity functions about that. They just use DEFAULT_COLLATION_OID independently of the actual collation of the data. I tripped over this while investigating making type "name"

Re: Making WAL receiver startup rely on GUC context for primary_conninfo and primary_slot_name

2018-12-12 Thread Sergei Kornilov
Hello > This allows the state of walrcv and startup to diverge, they could e.g. have > different configuration, due to differently time config reloads. So we have exactly same problem with, for example, hot_standby_feedback, right? We change hot_standby_feedback value, reload it and we can have

Re: Reorganize collation lookup time and place

2018-12-12 Thread Andreas Karlsson
On 12/10/18 4:12 PM, Peter Eisentraut wrote: Attached is a patch that reorganizes how and where collations are looked up. Until now, a fmgr C function that makes use of collation information (for example varstr_cmp(), str_toupper()) gets passed the collation OID, looks up the collation with

Re: [HACKERS] Can ICU be used for a database's default sort order?

2018-12-12 Thread Daniel Verite
Peter Eisentraut wrote: > Another issue is that we'd need to carefully divide up the role of the > "default" collation and the "default" provider. The default collation > is the collation defined for the database, the default provider means to > use the libc non-locale_t enabled API

Re: Record last password change

2018-12-12 Thread Bear Giles
Could you add your own UPDATE trigger to the password table? It can write an entry to a new table, e.g., (userid, current date) whenever a record in that table is modified. On an earlier question - the issue isn't whether someone can crack your password, it's possible disclosure in archive media

Re: Remove Deprecated Exclusive Backup Mode

2018-12-12 Thread David Steele
On 12/11/18 11:31 PM, Robert Haas wrote: > On Wed, Dec 12, 2018 at 1:23 PM David Steele wrote: >> I didn't get the impression that Peter was against, he just thought that >> it needed to stand on its own, rather than be justified by the >> recovery.conf changes, which I agree with. >> >> Simon

Re: Connections hang indefinitely while taking a gin index's LWLock buffer_content lock

2018-12-12 Thread Andrey Borodin
Hi! > 12 дек. 2018 г., в 3:26, Alexander Korotkov написал(а): > > BTW, I still can't see you're setting deleteXid field of > ginxlogDeletePage struct anywhere. Oops. Fixed. > > Also, I note that protection against re-usage of recently deleted > pages is implemented differently than it is in

Re: Updated backup APIs for non-exclusive backups

2018-12-12 Thread David Steele
On 12/12/18 12:58 AM, Laurenz Albe wrote: > On Tue, 2018-12-11 at 23:43 -0500, David Steele wrote: > [about managing backups from pre- and post-file-system-backup scrips] >>> I have come up with some sample code here: >>> https://github.com/cybertec-postgresql/safe-backup >>> >>> This just

Re: Add timeline to partial WAL segments

2018-12-12 Thread David Steele
On 12/12/18 12:14 AM, Michael Paquier wrote: > On Tue, Dec 11, 2018 at 11:27:30PM -0500, David Steele wrote: >> And yeah, I'm not sure that I'm totally sold on this idea either, but I >> wanted to get a conversation going. > > Another idea which I think we could live with is to embed within the >

Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

2018-12-12 Thread Amit Kapila
On Wed, Dec 12, 2018 at 3:54 PM Haribabu Kommi wrote: > > > On Thu, Nov 29, 2018 at 1:57 PM Amit Kapila wrote: >> >> On Wed, Nov 28, 2018 at 7:13 PM Alvaro Herrera >> wrote: >> > >> > On 2018-Nov-28, Amit Kapila wrote: >> > >> > > The problem with this idea is that if someone specifies a

Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

2018-12-12 Thread Haribabu Kommi
On Thu, Nov 29, 2018 at 1:57 PM Amit Kapila wrote: > On Wed, Nov 28, 2018 at 7:13 PM Alvaro Herrera > wrote: > > > > On 2018-Nov-28, Amit Kapila wrote: > > > > > The problem with this idea is that if someone specifies a particular > > > parameter using query and the query doesn't return any

Re: Undo logs

2018-12-12 Thread Amit Kapila
On Wed, Dec 12, 2018 at 11:18 AM Dilip Kumar wrote: > > On Sat, Dec 8, 2018 at 7:52 PM Amit Kapila wrote: >> >> >> I think I see the problem in the discard mechanism when the log is >> spread across multiple logs. Basically, if the second log contains >> undo of some transaction prior to the

Re: Making WAL receiver startup rely on GUC context for primary_conninfo and primary_slot_name

2018-12-12 Thread Simon Riggs
On Wed, 12 Dec 2018 at 05:35, Andres Freund wrote: > >What do you think about the attached to simplify the logic? Even if > >primary_conninfo and primary_slot_name are not switched to SIGHUP this > >cleanup looks like a good thing to me. > > I am not convinced this is a good idea. This allows

Re: proposal: plpgsql pragma statement

2018-12-12 Thread Pavel Stehule
čt 6. 12. 2018 v 18:27 odesílatel Pavel Stehule napsal: > > > čt 6. 12. 2018 v 18:17 odesílatel Robert Haas > napsal: > >> On Thu, Dec 6, 2018 at 12:13 PM Pavel Stehule >> wrote: >> > My idea about plpgsql PRAGMA is very close to PL/SQL or Ada PRAGMA. >> This is not runtime statement - the