Re: bytea bitwise logical operations implementation (xor / and / or / not)

2018-01-11 Thread Fabien COELHO
Hello Christian, Currently, `bytea` does not have any bitwise logical operations yet. This issue came up in an old thread from 2006 [1], but nobody seemed to have picked this issue so far. I remember this one because I needed them for checksuming set of rows. There is a whole set of missing

Re: [HACKERS] postgres_fdw bug in 9.6

2018-01-11 Thread Etsuro Fujita
(2018/01/12 10:41), Thomas Munro wrote: On Mon, Dec 11, 2017 at 8:25 PM, Etsuro Fujita wrote: Now, if you're still super-concerned about this breaking something, we could commit it only to master, where it will have 9 months to bake before it gets released. I

Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

2018-01-11 Thread amul sul
On Thu, Jan 11, 2018 at 8:06 PM, Stephen Frost wrote: > Amul, > > * amul sul (sula...@gmail.com) wrote: >> Agree, updated in the attached patch. Patch 0001 also includes your >> previous review comment[1] and typo correction suggested by Alvaro[2]. > > Looks like this needs

Re: PATCH: psql tab completion for SELECT

2018-01-11 Thread Edmund Horner
Hi, here's a new patch. This one makes some changes to the criteria for which functions to include; namely filtering out trigger functions and those that take or return values of type "internal"; and including aggregate and window functions. Some of the other checks could be removed as they were

Re: CREATE ROUTINE MAPPING

2018-01-11 Thread David Fetter
On Thu, Jan 11, 2018 at 09:37:43PM -0500, Corey Huinker wrote: > A few months ago, I was researching ways for formalizing calling functions > on one postgres instance from another. RPC, basically. In doing so, I > stumbled across an obscure part of the the SQL Standard called ROUTINE > MAPPING,

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-11 Thread Haribabu Kommi
On Fri, Jan 12, 2018 at 4:06 PM, Michael Paquier wrote: > On Fri, Jan 12, 2018 at 03:55:04PM +1100, Haribabu Kommi wrote: > > Before posting the patch, first I did the same, upon further study > > I didn't find any scenario where the value is not present in > >

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-11 Thread Michael Paquier
On Fri, Jan 12, 2018 at 03:55:04PM +1100, Haribabu Kommi wrote: > Before posting the patch, first I did the same, upon further study > I didn't find any scenario where the value is not present in > conn->connhost[conn->whichhost].host and present in conn->pghost. > > If user provides "host" as

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-11 Thread Haribabu Kommi
On Fri, Jan 12, 2018 at 3:26 PM, Michael Paquier wrote: > On Fri, Jan 12, 2018 at 11:37:22AM +0900, Michael Paquier wrote: > > I have redone my set of previous tests and can confirm that PQhost is > > behaving as I would expect it should, and those results are the same

Re: Parameters in user-defined aggregate final functions

2018-01-11 Thread Tom Lane
Robert Haas writes: > On Thu, Jan 11, 2018 at 6:11 PM, Tom Lane wrote: >> So define it as an ordered-set aggregate, and just ignore the question >> of whether you need to sort the input (which is something that we leave >> to the aggregate function to

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-11 Thread Michael Paquier
On Fri, Jan 12, 2018 at 11:37:22AM +0900, Michael Paquier wrote: > I have redone my set of previous tests and can confirm that PQhost is > behaving as I would expect it should, and those results are the same as > yours. if (conn->connhost != NULL && -

Re: [Sender Address Forgery]Re: [Sender Address Forgery]Re: [Sender Address Forgery]Re: [HACKERS] path toward faster partition pruning

2018-01-11 Thread Amit Langote
David, On 2018/01/12 12:30, David Rowley wrote: > Can you also perform a self-review of the patch? Some of the things > I'm picking up are leftovers from a previous version of the patch. We > might never get through this review if you keep leaving those around! Sorry, I will look more closely

Re: [HACKERS] GUC for cleanup indexes threshold.

2018-01-11 Thread Masahiko Sawada
On Wed, Jan 10, 2018 at 11:28 AM, Masahiko Sawada wrote: > On Sun, Jan 7, 2018 at 8:40 AM, Peter Geoghegan wrote: >> On Sat, Jan 6, 2018 at 2:20 PM, Stephen Frost wrote: > IIRC the patches that makes the cleanup scan skip has a

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

2018-01-11 Thread Thomas Munro
On Fri, Jan 12, 2018 at 4:19 PM, Robert Haas wrote: > On Thu, Jan 11, 2018 at 6:01 PM, Thomas Munro > wrote: >> [ the data isn't session lifetime ] >> >> So I agree with Tom's suggestion: >> >> On Wed, Oct 4, 2017 at 2:29 PM, Tom Lane

Re: [HACKERS] Crash on promotion when recovery.conf is renamed

2018-01-11 Thread Stephen Frost
Magnus, * Michael Paquier (michael.paqu...@gmail.com) wrote: > On Mon, Oct 2, 2017 at 3:29 PM, Michael Paquier > wrote: > > On Mon, Oct 2, 2017 at 8:13 AM, Daniel Gustafsson wrote: > >> I’ve moved this to the next CF, but since this no longer applies

Re: [Sender Address Forgery]Re: [Sender Address Forgery]Re: [HACKERS] path toward faster partition pruning

2018-01-11 Thread David Rowley
On 12 January 2018 at 15:27, Amit Langote wrote: > On 2018/01/11 19:23, David Rowley wrote: >> ERROR: operator 531 is not a member of opfamily 1976 > > You'll be able to see that the error no longer appears with the attached > updated set of patches, but I'm now

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

2018-01-11 Thread Robert Haas
On Thu, Jan 11, 2018 at 6:01 PM, Thomas Munro wrote: > [ the data isn't session lifetime ] > > 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

Re: Parameters in user-defined aggregate final functions

2018-01-11 Thread Robert Haas
On Thu, Jan 11, 2018 at 6:11 PM, Tom Lane wrote: > Esteban Zimanyi writes: >> How to tell PostgreSQL that my final function also needs a parameter? I am >> working on PostgreSQL 10.1. I know that according to the documentation >> direct parameters are only

Re: IndexTupleDSize macro seems redundant

2018-01-11 Thread Robert Haas
On Thu, Jan 11, 2018 at 9:17 PM, Stephen Frost wrote: > Great, thanks, I'll mark it as Ready For Committer then. > > Robert, since you were on this thread and the patch is mostly yours > anyway, did you want to commit it? I'm happy to do so also, either way. Feel free. --

Re: [HACKERS] Fix duplicated "the" occurrences in codebase

2018-01-11 Thread Bruce Momjian
On Mon, Oct 30, 2017 at 05:43:02PM +0100, Christoph Dreis wrote: > Hey, > > please find a patch attached that fixes duplicated "the" occurrences in the > codebase. > > As this is my first patch, please let me know in case I did something wrong. Patch applied in git head. Thanks. -- Bruce

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-11 Thread Michael Paquier
On Wed, Jan 10, 2018 at 04:10:35PM +1100, Haribabu Kommi wrote: > On Tue, Jan 9, 2018 at 12:15 PM, Michael Paquier > wrote: >> Hm. Any users of psql's PROMPT would be equally confused, and this can >> actually lead to more confusion from the user prospective I think

Re: [PATCH] using arc4random for strong randomness matters.

2018-01-11 Thread Stephen Frost
David, all, * David CARLIER (devne...@gmail.com) wrote: > > IIUC, what this code actually does is reseed itself from /dev/urandom > > every so often and work from a PRNG in between. That's not a layer that > > we need, because the code on top is already designed to cope with the > > foibles of

CREATE ROUTINE MAPPING

2018-01-11 Thread Corey Huinker
A few months ago, I was researching ways for formalizing calling functions on one postgres instance from another. RPC, basically. In doing so, I stumbled across an obscure part of the the SQL Standard called ROUTINE MAPPING, which is exactly what I'm looking for. The syntax specified is, roughly:

Re: Transform for pl/perl

2018-01-11 Thread Thomas Munro
On Thu, Dec 7, 2017 at 10:56 PM, Anthony Bykov wrote: >> Please, find a new version of the patch in attachments to this >> message. Hi again Anthony, I wonder why make check passes for me on my Mac, but when Travis CI (Ubuntu Trusty on amd64) runs it, it fails like this:

Re: IndexTupleDSize macro seems redundant

2018-01-11 Thread Stephen Frost
Tom, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > Updated (combined) patch attached for review. I went through and looked > > again to make sure there weren't any cases of making an unaligned > > pointer to a struct and didn't see any, and I added some

Re: Add default role 'pg_access_server_files'

2018-01-11 Thread Stephen Frost
Thomas, * Thomas Munro (thomas.mu...@enterprisedb.com) wrote: > On Mon, Jan 1, 2018 at 8:19 AM, Stephen Frost wrote: > > This patch adds a new default role called 'pg_access_server_files' which > > allows an administrator to GRANT to a non-superuser role the ability to > >

Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)

2018-01-11 Thread Peter Geoghegan
On Thu, Jan 11, 2018 at 2:26 PM, Robert Haas wrote: > While the patch contains, as I said before, an excellent set of how-to > directions explaining how to use the new parallel sort facilities in > tuplesort.c, there seems to be no such thing for logtape.c, and as a >

Re: Add default role 'pg_access_server_files'

2018-01-11 Thread Thomas Munro
On Mon, Jan 1, 2018 at 8:19 AM, Stephen Frost wrote: > Greetings, > > This patch adds a new default role called 'pg_access_server_files' which > allows an administrator to GRANT to a non-superuser role the ability to > access server-side files through PostgreSQL (as the user

Re: [HACKERS] Support to COMMENT ON DATABASE CURRENT_DATABASE

2018-01-11 Thread Stephen Frost
Greetings Jing, * Jing Wang (jingwang...@gmail.com) wrote: > I have rebased the patch on the latest version. Thanks! Looks like there's still more work to be done here, and unfortunately this ended up on a new thread somehow from the prior one. I've added this newer thread to the CF app too. >

Re: [HACKERS] Bug in to_timestamp().

2018-01-11 Thread Thomas Munro
On Thu, Nov 23, 2017 at 4:23 AM, Arthur Zakirov wrote: > I've attached new version of the patch. It is a little bit simpler now than > the previous one. > The patch doesn't handle backslashes now, since there was a commit which > fixes quoted-substring handling

Re: add queryEnv to ExplainOneQuery_hook

2018-01-11 Thread Tatsuro Yamada
On 2018/01/12 2:02, Tom Lane wrote: Thomas Munro writes: On Fri, Jan 12, 2018 at 12:16 AM, Tatsuro Yamada wrote: I found a variable (queryEnv) which should be added in ExplainOneQuery_hook because if it is missing, hook function

Re: add queryEnv to ExplainOneQuery_hook

2018-01-11 Thread Tatsuro Yamada
On 2018/01/11 21:46, Michael Paquier wrote: I'm surprised we haven't heard any complaints sooner if there are advisors using that hook[1] and expecting to be able to forward to ExplainOnePlan(), but I suppose it would nearly always works to call ExplainOnePlan() with NULL as queryEnv. It'd

Re: [HACKERS] postgres_fdw bug in 9.6

2018-01-11 Thread Thomas Munro
On Mon, Dec 11, 2017 at 8:25 PM, Etsuro Fujita wrote: >> Now, if you're still super-concerned about this breaking something, we >> could commit it only to master, where it will have 9 months to bake >> before it gets released. I think that's overly conservative, but

Re: [HACKERS] Re: proposal - psql: possibility to specify sort for describe commands, when size is printed

2018-01-11 Thread Thomas Munro
On Thu, Nov 2, 2017 at 12:44 AM, Pavel Stehule wrote: > I am sending updated patch with some basic doc Hi Pavel, I am not sure what the status of this patch is, but FYI: startup.c: In function ‘main’: startup.c:284:3: error: too few arguments to function ‘listAllDbs’

Possible performance regression with pg_dump of a large number of relations

2018-01-11 Thread Luke Cowell
I've been troubleshooting an issue with slow pg_dump times on postgres 9.6.6. I believe something changed between 9.5.10 and 9.6.6 that has made dumps significantly slower for databases with a large number of relations. I posted this in irc and someone suggested that I should post this here.

Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs

2018-01-11 Thread Michael Paquier
On Thu, Jan 11, 2018 at 10:42:38AM -0500, Tom Lane wrote: > Michael Paquier writes: >> guc.c already holds a find_option() >> which can be used to retrieve the flags of a parameter. What about using >> that and filtering by GUC_LIST_INPUT? This requires exposing the >>

Re: [HACKERS] Support to COMMENT ON DATABASE CURRENT_DATABASE

2018-01-11 Thread Thomas Munro
On Mon, Dec 4, 2017 at 1:34 PM, Jing Wang wrote: > I have rebased the patch on the latest version. Hi Jing, According to my testing robot this fails make check-world (or presumably cd src/bin/pg_dump ; make check), here: t/001_basic.pl . ok # Failed test

Re: [HACKERS] Cache lookup errors with functions manipulation object addresses

2018-01-11 Thread Thomas Munro
On Mon, Nov 27, 2017 at 1:01 AM, Michael Paquier wrote: > On Fri, Nov 24, 2017 at 9:13 PM, Michael Paquier > wrote: >> Attached is a rebased patch set. Álvaro, as you have introduced most >> of the problems with 4464303 & friends dated of

Re: Jsonb transform for pl/python

2018-01-11 Thread Thomas Munro
On Thu, Dec 7, 2017 at 12:40 AM, Anthony Bykov wrote: > Hello, > fixed the issues: > 1. Rising errors when invalid object being transformed. > 2. We don't rise the exception when transforming range(3) only in > python 2. In third one it is an error. > > Please, find the

Re: [HACKERS] taking stdbool.h into use

2018-01-11 Thread Tom Lane
Peter Eisentraut writes: > That leaves the uses in rowtypes.c. Those were introduced as a > portability fix by commit 4cbb646334b. I'm curious why these are > necessary. The Datums they operate come from heap_deform_tuple(), which > gets them from fetchatt(),

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2018-01-11 Thread Greg Stark
On 11 January 2018 at 19:41, Peter Eisentraut wrote: > Two, what to do when the memory limit is reached. With the old > accounting, this was easy, because we'd decide for each subtransaction > independently whether to spill it to disk, when it has reached its

Re: IndexTupleDSize macro seems redundant

2018-01-11 Thread Tom Lane
Stephen Frost writes: > Updated (combined) patch attached for review. I went through and looked > again to make sure there weren't any cases of making an unaligned > pointer to a struct and didn't see any, and I added some comments to > _bt_restore_page(). Looks OK from

Re: [HACKERS] Planning counters in pg_stat_statements

2018-01-11 Thread Haribabu Kommi
On Thu, Jan 11, 2018 at 10:00 PM, Thomas Munro < thomas.mu...@enterprisedb.com> wrote: > On Thu, Jan 11, 2018 at 7:36 PM, Haribabu Kommi > wrote: > > > +OUT plans int8, > > > > Addition of this column is good to find out how many time the plan is > > generated > >

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2018-01-11 Thread Vaishnavi Prabakaran
On Fri, Jan 5, 2018 at 4:55 PM, Vaishnavi Prabakaran < vaishnaviprabaka...@gmail.com> wrote: > > > On Tue, Nov 28, 2017 at 12:57 PM, Michael Paquier < > michael.paqu...@gmail.com> wrote: > >> On Thu, Oct 5, 2017 at 9:58 AM, Vaishnavi Prabakaran >> wrote: >> >

Re: Parameters in user-defined aggregate final functions

2018-01-11 Thread Tom Lane
Esteban Zimanyi writes: > How to tell PostgreSQL that my final function also needs a parameter? I am > working on PostgreSQL 10.1. I know that according to the documentation > direct parameters are only allowed for ordered-set aggregates, but I would > also need a direct

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

2018-01-11 Thread Thomas Munro
On Fri, Oct 6, 2017 at 2:45 AM, Robert Haas wrote: > On Tue, Oct 3, 2017 at 9:38 PM, Andres Freund wrote: >>> Do you have any suggestion as to how we should transmit the blacklist to >>> parallel workers? >> >> How about storing them in the a dshash

Re: Parameters in user-defined aggregate final functions

2018-01-11 Thread David Fetter
On Thu, Jan 11, 2018 at 08:51:27PM +0100, Esteban Zimanyi wrote: > I am creating a user-defined aggregate function that needs an additional > parameter. More precisely it is a cumulative (aka window) minimum that > takes as second parameter a time interval defining the window. Since the >

Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)

2018-01-11 Thread Robert Haas
On Wed, Jan 10, 2018 at 1:45 PM, Robert Haas wrote: > There's a lot here I haven't grokked yet, but I'm running out of > mental energy so I think I'll send this for now and work on this some > more when time permits, hopefully tomorrow. Looking at the logtape changes:

Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)

2018-01-11 Thread Peter Geoghegan
On Thu, Jan 11, 2018 at 1:44 PM, Robert Haas wrote: >> A third option here is to specifically recognize that >> compute_parallel_worker() returned a value based on the table storage >> param max_workers, and for that reason alone no "insufficient memory >> per participant"

Re: [HACKERS] taking stdbool.h into use

2018-01-11 Thread Peter Eisentraut
On 1/9/18 00:17, Michael Paquier wrote: >> * When a type narrower than Datum is stored in a Datum, we place it in the >> * low-order bits and are careful that the DatumGetXXX macro for it discards >> * the unused high-order bits (as opposed to, say, assuming they are zero). >> * This is needed

Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)

2018-01-11 Thread Robert Haas
On Thu, Jan 11, 2018 at 3:25 PM, Peter Geoghegan wrote: > On Thu, Jan 11, 2018 at 12:06 PM, Peter Geoghegan wrote: >> It might make sense to have the "minimum memory per participant" value >> come from a GUC, rather than be hard coded (it's currently hard-coded >> to

Re: IndexTupleDSize macro seems redundant

2018-01-11 Thread Stephen Frost
Greetings Tom, Robert, Ildar, all, * Stephen Frost (sfr...@snowman.net) wrote: > That said, since it's not aligned, regardless of the what craziness the > compiler might try to pull, we probably shouldn't go casting it > to something that later hackers might think will be aligned, but we > should

Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)

2018-01-11 Thread Peter Geoghegan
On Thu, Jan 11, 2018 at 12:06 PM, Peter Geoghegan wrote: > It might make sense to have the "minimum memory per participant" value > come from a GUC, rather than be hard coded (it's currently hard-coded > to 32MB). > What do you think of that idea? A third option here is to

Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)

2018-01-11 Thread Peter Geoghegan
On Thu, Jan 11, 2018 at 11:51 AM, Robert Haas wrote: > I think the force_parallel_mode thing is too ugly to live. I'm not > sure that forcing low memory in workers is a thing we need to have, > but if we do, then we'll have to invent some other way to have it. It might

Re: CUBE seems a bit confused about ORDER BY

2018-01-11 Thread Teodor Sigaev
This was discussed upthread and the solution found was "objects need to be rebuilt, indexes need to be reindexed". The point of Alexander's query was to find affected objects that need such treatment. Teodor explicitly disregarded any change in pg_upgrade because the database you're upgrading

Parameters in user-defined aggregate final functions

2018-01-11 Thread Esteban Zimanyi
I am creating a user-defined aggregate function that needs an additional parameter. More precisely it is a cumulative (aka window) minimum that takes as second parameter a time interval defining the window. Since the aggregate function operates on my user-defined data types I have conveyed a dummy

Re: CUBE seems a bit confused about ORDER BY

2018-01-11 Thread Alexander Korotkov
On Thu, Jan 11, 2018 at 10:29 PM, Alvaro Herrera wrote: > Tom Lane wrote: > > What we've done in the past for comparable situations is to make the > > change in a new major version and teach pg_upgrade to detect and report > > the need for changes --- in this case, it

Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)

2018-01-11 Thread Robert Haas
On Wed, Jan 10, 2018 at 5:42 PM, Peter Geoghegan wrote: > On Wed, Jan 10, 2018 at 2:21 PM, Robert Haas wrote: >>> I share your general feelings on all of this, but I really don't know >>> what to do about it. Which of these alternatives is the least worst,

Re: [HACKERS] [PATCH] Generic type subscripting

2018-01-11 Thread Robert Haas
On Thu, Jan 11, 2018 at 2:20 PM, Tom Lane wrote: > But I think we've probably beaten this topic to death ... Yep. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: [HACKERS] UPDATE of partition key

2018-01-11 Thread Robert Haas
On Thu, Jan 11, 2018 at 6:07 AM, Amit Khandekar wrote: > In the first paragraph of my explanation, I was explaining why two > Transition capture states does not look like a good idea to me : Oh, sorry. I didn't read what you wrote carefully enough, I guess. I see your

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2018-01-11 Thread Peter Eisentraut
On 12/22/17 23:57, Tomas Vondra wrote: > PART 1: adding logical_work_mem memory limit (0001) > --- > > Currently, limiting the amount of memory consumed by logical decoding is > tricky (or you might say impossible) for several reasons: I would like

Re: CUBE seems a bit confused about ORDER BY

2018-01-11 Thread Alvaro Herrera
Tom Lane wrote: > Alvaro Herrera writes: > > This was discussed upthread and the solution found was "objects need to > > be rebuilt, indexes need to be reindexed". The point of Alexander's > > query was to find affected objects that need such treatment. Teodor > >

Re: [HACKERS] [PATCH] Generic type subscripting

2018-01-11 Thread Tom Lane
Robert Haas writes: > On Thu, Jan 11, 2018 at 1:37 PM, Tom Lane wrote: >> Right, but in the case of stored arrays, we've decided that it *is* >> our problem (as indeed it must be, because the user has no tools with >> which they could fix a

Re: [HACKERS] [PATCH] Generic type subscripting

2018-01-11 Thread Robert Haas
On Thu, Jan 11, 2018 at 1:37 PM, Tom Lane wrote: >> I don't think I missed the point at all -- this is the exact same set >> of issues that arise with respect to functions. Indeed, I gave an >> example of a function that needs to be updated if a column of the >> input type is

bytea bitwise logical operations implementation (xor / and / or / not)

2018-01-11 Thread Christian Rossow
Hackers, Currently, `bytea` does not have any bitwise logical operations yet. This issue came up in an old thread from 2006 [1], but nobody seemed to have picked this issue so far. Being in the need for this myself, I copied the bit vector's bitwise logical operations and converted them to

Re: IndexTupleDSize macro seems redundant

2018-01-11 Thread Robert Haas
On Thu, Jan 11, 2018 at 1:26 PM, Tom Lane wrote: >> I certainly hadn't been thinking about that. I didn't see any >> issues in my testing (where I created a table with a btree index and >> insert'd a bunch of records into and then killed the server, forcing WAL >> replay and

Re: refactor subscription tests to use PostgresNode's wait_for_catchup

2018-01-11 Thread Peter Eisentraut
On 1/10/18 22:24, Michael Paquier wrote: > On Wed, Jan 10, 2018 at 09:45:56PM -0500, Peter Eisentraut wrote: >> On 1/8/18 23:47, Michael Paquier wrote: >> Should we just remove it? Apparently, it was never functional to begin >> with. Otherwise, we'd have to write a second query to return the

Re: [HACKERS] [PATCH] Generic type subscripting

2018-01-11 Thread Tom Lane
Robert Haas writes: > On Thu, Jan 11, 2018 at 1:15 PM, Tom Lane wrote: >> I think you missed the point. The question is whether the existence of a >> subscripting function means that we need to treat the subscriptable type >> as physically containing

Re: IndexTupleDSize macro seems redundant

2018-01-11 Thread Andres Freund
On 2018-01-11 13:26:27 -0500, Tom Lane wrote: > I wonder whether there is a way to get alignment traps on Intel-type > hardware. It's getting less and less likely that most hackers are > developing on anything else, so that we don't see gotchas of this > type until code hits the buildfarm (and

Re: [HACKERS] [PATCH] Generic type subscripting

2018-01-11 Thread Robert Haas
On Thu, Jan 11, 2018 at 1:15 PM, Tom Lane wrote: > I think you missed the point. The question is whether the existence of a > subscripting function means that we need to treat the subscriptable type > as physically containing the subscript result type. For example, if the >

Re: IndexTupleDSize macro seems redundant

2018-01-11 Thread Tom Lane
Stephen Frost writes: > * Tom Lane (t...@sss.pgh.pa.us) wrote: >> I'm on board with Stephen's changes, except in _bt_restore_page. >> The issue there is that the "from" pointer isn't necessarily adequately >> aligned to be considered an IndexTuple pointer; that's why we're

Re: IndexTupleDSize macro seems redundant

2018-01-11 Thread Stephen Frost
Tom, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > I'll leave the patch status in 'Needs review' since there's more > > changes, but hopefully someone can take a look and we can move this > > along, seems like a pretty small and reasonable improvement. >

Re: [HACKERS] [PATCH] Generic type subscripting

2018-01-11 Thread Tom Lane
Robert Haas writes: > On Wed, Jan 10, 2018 at 7:09 PM, Tom Lane wrote: >> * The complaint I had about the "container" terminology isn't just >> terminology. Rather, there is a bunch of knowledge in the system that >> some data types can be found

Re: IndexTupleDSize macro seems redundant

2018-01-11 Thread Tom Lane
Stephen Frost writes: > I'll leave the patch status in 'Needs review' since there's more > changes, but hopefully someone can take a look and we can move this > along, seems like a pretty small and reasonable improvement. I'm on board with Stephen's changes, except in

Re: master make check fails on Solaris 10

2018-01-11 Thread Andres Freund
Hi, On 2018-01-11 20:21:11 +0300, Marina Polyakova wrote: > Hello, hackers! I got a permanent failure of master (commit > ca454b9bd34c75995eda4d07c9858f7c22890c2b) make check on Solaris 10. Did this use to work? If so, could you check whether it worked before

Re: master make check fails on Solaris 10

2018-01-11 Thread Tom Lane
Marina Polyakova writes: > Hello, hackers! I got a permanent failure of master (commit > ca454b9bd34c75995eda4d07c9858f7c22890c2b) make check on Solaris 10. > Regression output and diffs are attached. Hm, buildfarm member protosciurus is running a similar

Re: [HACKERS] [PATCH] Generic type subscripting

2018-01-11 Thread Robert Haas
On Wed, Jan 10, 2018 at 7:09 PM, Tom Lane wrote: > * The complaint I had about the "container" terminology isn't just > terminology. Rather, there is a bunch of knowledge in the system that > some data types can be found embedded in other types; for one example, > see

Re: IndexTupleDSize macro seems redundant

2018-01-11 Thread Stephen Frost
Robert, all, * Robert Haas (robertmh...@gmail.com) wrote: > On Tue, Nov 21, 2017 at 9:26 AM, Amit Kapila wrote: > > +1. I was also once confused with these macros. I think this is a > > good cleanup. On a quick look, I don't see any problem with your > > changes. > >

master make check fails on Solaris 10

2018-01-11 Thread Marina Polyakova
Hello, hackers! I got a permanent failure of master (commit ca454b9bd34c75995eda4d07c9858f7c22890c2b) make check on Solaris 10. Regression output and diffs are attached. I used the following commands: ./configure CC="ccache gcc" CFLAGS="-m64 -I/opt/csw/include" LDFLAGS="-L/opt/csw/lib/sparcv9

Re: add queryEnv to ExplainOneQuery_hook

2018-01-11 Thread Tom Lane
Thomas Munro writes: > On Fri, Jan 12, 2018 at 12:16 AM, Tatsuro Yamada > wrote: >> I found a variable (queryEnv) which should be added in >> ExplainOneQuery_hook because if it is missing, hook function >> can't call ExplainOnePlan. >

Re: Minor code improvement to estimate_path_cost_size in postgres_fdw

2018-01-11 Thread Tom Lane
Tatsuro Yamada writes: > The declaration of estimate_path_cost_size uses baserel, but > the actual definition uses foreignrel. It would be better to sync. Yeah, the join_conds parameter's been renamed at some point too :-( Fixed. regards,

[PATCH] ECPG bug fix in preproc when indicator struct is shorter than record struct

2018-01-11 Thread Rader, David
Hello - Attached is a proposed patch to fix a bug in the ECPG preprocessor that generates application code that core dumps at run-time. When the input pgc code uses a record struct for returning query results and uses an indicator struct that has fewer fields than the record struct, the generated

Re: numeric regression test passes, but why?

2018-01-11 Thread Chapman Flack
On 01/11/2018 11:23 AM, Alvaro Herrera wrote: > Dagfinn Ilmari Mannsåker wrote: >> ilm...@ilmari.org (Dagfinn Ilmari Mannsåker) writes: >> >>> The behaviour seems to have changed in 9.6: >> >> Indeed, https://www.postgresql.org/docs/current/static/release-9-6.html >> has the following entry: >> >>

Re: Identifying ALTER TABLE "sub-command"

2018-01-11 Thread Alvaro Herrera
Jeremy Finzel wrote: > Hello - > > I have found that in leveraging the parser code to decode DDL SQL, it is > very easy to get which type of general command is being issued with > CreateCommandTag(parsetree). However, is there a way (or a starting point) > to identify the sub-command as well

Re: numeric regression test passes, but why?

2018-01-11 Thread Alvaro Herrera
Dagfinn Ilmari Mannsåker wrote: > ilm...@ilmari.org (Dagfinn Ilmari Mannsåker) writes: > > > The behaviour seems to have changed in 9.6: > > Indeed, https://www.postgresql.org/docs/current/static/release-9-6.html > has the following entry: > > * Improve the accuracy of the ln(), log(), exp(),

Re: General purpose hashing func in pgbench

2018-01-11 Thread Ildar Musin
10/01/2018 21:42, Fabien COELHO пишет: > > Hmm. I do not think that we should want a shared seed value. The seed > should be different for each call so as to avoid undesired > correlations. If wanted, correlation could be obtained by using an > explicit identical seed. > > ISTM that the best way

Re: Identifying ALTER TABLE "sub-command"

2018-01-11 Thread Sergei Kornilov
HelloYou can start with functions ATPrepCmd and ATExecCmd in src/backend/commands/tablecmds.cAlso note, one alter table statement can have multiple different actions. Regards, Sergei11.01.2018, 18:56, "Jeremy Finzel" :Hello -I have found that in leveraging the parser code to

Re: numeric regression test passes, but why?

2018-01-11 Thread Chapman Flack
On 01/11/2018 07:44 AM, Sergei Kornilov wrote: > Hello > I am surprised, but i can confirm error on versions prior 9.6: on 9.5, 9.4, > 9.3 same error. On 9.6 and 10 query works correctly One of my tests (in fact, the one where I first noticed) was a build from git a couple days ago at

Re: The first function call

2018-01-11 Thread David G. Johnston
On Thu, Jan 11, 2018 at 8:52 AM, Diego Silva e Silva wrote: > Hello, > > The first function call is 10 times slower than the other calls in the > same session. Is it possible to shorten this long time on the first call? > For example. Call my function for once, this call

Re: The first function call

2018-01-11 Thread Tom Lane
Diego Silva e Silva writes: > The first function call is 10 times slower than the other calls in the same > session. Is it possible to shorten this long time on the first call? > For example. Call my function for once, this call returns at 70ms on the > next call, the return

Identifying ALTER TABLE "sub-command"

2018-01-11 Thread Jeremy Finzel
Hello - I have found that in leveraging the parser code to decode DDL SQL, it is very easy to get which type of general command is being issued with CreateCommandTag(parsetree). However, is there a way (or a starting point) to identify the sub-command as well i.e. ENABLE TRIGGER, ADD FOREIGN

Re: CUBE seems a bit confused about ORDER BY

2018-01-11 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> Was there any real discussion of whether we could get away with that >> in the back branches? My opinion is no. It's not even clear to me >> that this is acceptable in HEAD --- isn't it going to create huge >> problems for

Re: General purpose hashing func in pgbench

2018-01-11 Thread Ildar Musin
Hello Fabien, 10/01/2018 21:42, Fabien COELHO пишет: Should we probably add some infrastructure for optional arguments? >>> >>> You can look at the handling of "CASE" which may or may not have an >>> "ELSE" clause. >>> >>> I'd suggest you use a new negative argument with the special meaning

Re: [HACKERS] PoC: custom signal handler for extensions

2018-01-11 Thread Arthur Zakirov
Hello, On Fri, Dec 22, 2017 at 03:05:25PM +0300, Maksim Milyutin wrote: > Hi, hackers! > > > I want to propose the patch that allows to define custom signals and their > handlers on extension side. > I've looked a little bit on the patch. The patch applyes and regression tests pass. I have a

The first function call

2018-01-11 Thread Diego Silva e Silva
Hello, The first function call is 10 times slower than the other calls in the same session. Is it possible to shorten this long time on the first call? For example. Call my function for once, this call returns at 70ms on the next call, the return is at 7ms. thanks.

Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs

2018-01-11 Thread Tom Lane
Michael Paquier writes: > While reviewing another patch related to the use of pg_strcasecmp in the > backend, I have noticed this bit in ruleutils.c: > /* > * Some GUC variable names are 'LIST' type and hence must not > * be quoted. > */ > if

Re: CUBE seems a bit confused about ORDER BY

2018-01-11 Thread Alvaro Herrera
Tom Lane wrote: > >> Since behavior of ~> (cube, int) operator is changed, depending entities > >> must be refreshed after upgrade. Such as, expression indexes using this > >> operator must be reindexed, materialized views must be rebuilt, stored > >> procedures and client code must be revised to

Animals baiji, mastodon and narwhal

2018-01-11 Thread Dave Page
Due to circumstances beyond my control, I've had to shut down the ageing Windows buildfarm animals in $SUBJECT. I hope to restart them at some point, but it might be some time. -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The

Re: CUBE seems a bit confused about ORDER BY

2018-01-11 Thread Tom Lane
Alvaro Herrera writes: > That's true, and I agree we don't necessarily have to find everything. > I still think we should print the pg_depend query in the relnotes, > because those would be the most common cases of objects that need to be > rebuilt. Wait. A. Minute.

Re: pl/perl extension fails on Windows

2018-01-11 Thread Andrew Dunstan
On 01/11/2018 12:08 AM, Noah Misch wrote: > On Sun, Dec 10, 2017 at 11:46:08AM -0800, Noah Misch wrote: >> On Sun, Dec 10, 2017 at 12:36:13PM +, Christian Ullrich wrote: >>> * Noah Misch wrote: On Wed, Nov 29, 2017 at 11:45:35PM -0500, Tom Lane wrote: > Oh, OK. In that case, we

Re: [HACKERS] [FEATURE PATCH] pg_stat_statements with plans (v02)

2018-01-11 Thread David Fetter
On Wed, Jan 10, 2018 at 03:05:39PM +0100, Julian Markwort wrote: > Hello hackers, > > I'd like to follow up to my previous proposition of tracking (some) best and > worst plans for different queries in the pg_stat_statements extension. > > Based on the comments and suggestions made towards my

  1   2   >