Re: [HACKERS] SQL/JSON in PostgreSQL

2017-09-29 Thread Pavel Stehule
g, and I think it should be shown now > to get a some kind of pre-review. > > We are supporting v11 and v10 branches in our github repository: > > https://github.com/postgrespro/sqljson/tree/sqljson > https://github.com/postgrespro/sqljson/tree/sqljson_wip > https://github.com/postgrespro/sqljson/tree/sqljson_v10 > https://github.com/postgrespro/sqljson/tree/sqljson_v10_wip > > Attached patches can be produced simply by combining groups of consecutive > commits from these branches. > > I have some free time now. Is it last version? Regards Pavel -- > Nikita Glukhov > Postgres Professional:http://www.postgrespro.com > The Russian Postgres Company > >

Re: [HACKERS] SQL/JSON in PostgreSQL

2017-09-29 Thread Pavel Stehule
2017-09-29 12:09 GMT+02:00 Nikita Glukhov : > > > I have some free time now. Is it last version? > > Regards > > Pavel > > Yes, this is still the latest version. Now I am working only on unfinished > WIP > patch no. 9, but I think it should be reviewed th

Re: [HACKERS] SQL/JSON in PostgreSQL

2017-09-29 Thread Pavel Stehule
2017-09-29 12:15 GMT+02:00 Pavel Stehule : > > > 2017-09-29 12:09 GMT+02:00 Nikita Glukhov : > >> >> >> I have some free time now. Is it last version? >> >> Regards >> >> Pavel >> >> Yes, this is still the latest version. Now I a

Re: [HACKERS] SQL/JSON in PostgreSQL

2017-09-29 Thread Pavel Stehule
2017-09-30 1:06 GMT+02:00 Nikita Glukhov : > On 29.09.2017 20:07, Pavel Stehule wrote: > > 2017-09-29 12:15 GMT+02:00 Pavel Stehule : > >> >> 2017-09-29 12:09 GMT+02:00 Nikita Glukhov : >> >>> >>> >>> I have some free time now. Is it last

[HACKERS] extension build issue with PostgreSQL 10 on Centos6

2017-09-29 Thread Pavel Stehule
This mean not optional dependency on ICU. Installed from rpm Regards Pavel

Re: [HACKERS] extension build issue with PostgreSQL 10 on Centos6

2017-09-29 Thread Pavel Stehule
2017-09-30 7:54 GMT+02:00 Pavel Stehule : > Hi > > There is new, not well solved dependency. I have not any problem to build > extension with PostgreSQL 9.6 there > > [oracle@ora2pg plpgsql_check]$ make > gcc -Wall -Wmissing-prototypes -Wpointer-arith > -Wdeclaration

Re: [HACKERS] extension build issue with PostgreSQL 10 on Centos6

2017-09-29 Thread Pavel Stehule
2017-09-30 8:18 GMT+02:00 Tom Lane : > Pavel Stehule writes: > > /usr/pgsql-10/include/server/utils/pg_locale.h:19:26: error: > > unicode/ucol.h: Adresář nebo soubor neexistuje > > > This mean not optional dependency on ICU. > > Really? That file has > >

[HACKERS] why subplan is 10x faster then function?

2017-09-30 Thread Pavel Stehule
ult on 9.6, 10. Is known overhead of function execution? Regards Pavel

Re: [HACKERS] extension build issue with PostgreSQL 10 on Centos6

2017-09-30 Thread Pavel Stehule
2017-10-01 4:55 GMT+02:00 Devrim Gündüz : > > Hi, > > On Sat, 2017-09-30 at 11:15 -0400, Tom Lane wrote: > > So the point is that postgresql-devel now needs to have a dependency > > on icu-devel. > > Oh, I see. Ack, added. Will appear in 10.0 RPMs. > Thank you

Re: [HACKERS] why subplan is 10x faster then function?

2017-10-01 Thread Pavel Stehule
2017-09-30 23:23 GMT+02:00 Pavel Stehule : > Hi > > I have some strange slow queries based on usage "view" functions > > one function looks like this: > > CREATE OR REPLACE FUNCTION ides_funcs.najdatsplt_cislo_exekuce(mid_najdatsplt > bigint) > RETURNS charac

Re: [HACKERS] why subplan is 10x faster then function?

2017-10-01 Thread Pavel Stehule
2017-10-01 12:45 GMT+02:00 Sokolov Yura : > 1 октября 2017 г. 12:42:14 GMT+03:00, Pavel Stehule < > pavel.steh...@gmail.com> пишет: > >2017-09-30 23:23 GMT+02:00 Pavel Stehule : > > > >> Hi > >> > >> I have some strange slow queries based on

Re: [HACKERS] why subplan is 10x faster then function?

2017-10-01 Thread Pavel Stehule
2017-09-30 23:23 GMT+02:00 Pavel Stehule : > Hi > > I have some strange slow queries based on usage "view" functions > > one function looks like this: > > CREATE OR REPLACE FUNCTION ides_funcs.najdatsplt_cislo_exekuce(mid_najdatsplt > bigint) > RETURNS charac

Re: [HACKERS] SQL/JSON in PostgreSQL

2017-10-01 Thread Pavel Stehule
2017-09-30 1:06 GMT+02:00 Nikita Glukhov : > On 29.09.2017 20:07, Pavel Stehule wrote: > > 2017-09-29 12:15 GMT+02:00 Pavel Stehule : > >> >> 2017-09-29 12:09 GMT+02:00 Nikita Glukhov : >> >>> >>> >>> I have some free time now. Is it last

Re: [HACKERS] proposal - Default namespaces for XPath expressions (PostgreSQL 11)

2017-10-02 Thread Pavel Stehule
2017-10-02 12:22 GMT+02:00 Kyotaro HORIGUCHI < horiguchi.kyot...@lab.ntt.co.jp>: > Hi, thanks for the new patch. > > # The patch is missing xpath_parser.h. That of the first patch was usable. > > At Thu, 28 Sep 2017 07:59:41 +0200, Pavel Stehule > wrote in mail.gmail

Re: [HACKERS] issue: record or row variable cannot be part of multiple-item INTO list

2017-10-02 Thread Pavel Stehule
scalar. List of scalars should be disallowed as target for composite value should be a) disallowed every time, b) disallowed when some target var is a composite. The differences between assign command and INTO command can be messy too. So the best solution should be one rules for := and INTO - but I am not sure if it is possible Comments? Regards Pavel > regards, tom lane >

Re: [HACKERS] pg_dump quietly ignore missing tables - is it bug?

2015-07-19 Thread Pavel Stehule
oesn't calculate quotes (but a replace has few lines only). There is a possibility to remove a wildcard char test and require least one entry for patters too. But I am thinking, when somebody explicitly uses any wildcard, then he calculate with a possibility of empty result. Regards P

Re: [HACKERS] pg_dump quietly ignore missing tables - is it bug?

2015-07-19 Thread Pavel Stehule
2015-07-19 20:54 GMT+02:00 Pavel Stehule : > Hi > > I am sending updated version. It implements new long option > "--strict-names". If this option is used, then for any entered name > (without any wildcard char) must be found least one object. This option has >

Re: [HACKERS] Implementation of global temporary tables?

2015-07-19 Thread Pavel Stehule
2015-07-19 21:39 GMT+02:00 Josh Berkus : > Pavel, All: > > Just to be clear, the idea of a global temp table is that the table def > is available to all users, but the data is private to each session? > yes. Pavel > > -- > Josh Berkus > PostgreSQL Experts Inc. > http://pgexperts.com >

Re: [HACKERS] pg_dump quietly ignore missing tables - is it bug?

2015-07-19 Thread Pavel Stehule
2015-07-19 21:08 GMT+02:00 Pavel Stehule : > > > 2015-07-19 20:54 GMT+02:00 Pavel Stehule : > >> Hi >> >> I am sending updated version. It implements new long option >> "--strict-names". If this option is used, then for any entered name >>

Re: [HACKERS] Implementation of global temporary tables?

2015-07-19 Thread Pavel Stehule
2015-07-20 5:33 GMT+02:00 Gavin Flower : > On 20/07/15 15:00, Pavel Stehule wrote: > >> >> >> 2015-07-19 21:39 GMT+02:00 Josh Berkus > j...@agliodbs.com>>: >> >> Pavel, All: >> >> Just to be clear, the idea of a global temp tabl

Re: [HACKERS] Implementation of global temporary tables?

2015-07-20 Thread Pavel Stehule
2015-07-20 11:07 GMT+02:00 Alvaro Herrera : > Pavel Stehule wrote: > > 2015-07-20 5:33 GMT+02:00 Gavin Flower : > > > > > Would it be difficult to add the ability for one user to share the > > > contents with a list of named other users (roles)? > > &

Re: [HACKERS] patch: enhanced DROP POLICY tab complete

2015-07-20 Thread Pavel Stehule
Thank you very much Pavel 2015-07-20 15:39 GMT+02:00 Alvaro Herrera : > Pavel Stehule wrote: > > Hi > > > > I am sending trivial patch, that enforce more precious tab complete for > > DROP POLICY statement > > Thanks, pushed and preciousified. > > -- >

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-21 Thread Pavel Stehule
2015-07-09 23:16 GMT+02:00 Pavel Stehule : > > > 2015-07-09 22:57 GMT+02:00 Merlin Moncure : > >> On Thu, Jul 9, 2015 at 3:31 PM, Pavel Stehule >> wrote: >> > >> > >> > 2015-07-09 20:08 GMT+02:00 Merlin Moncure : >> >> >&

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-21 Thread Pavel Stehule
2015-07-21 9:53 GMT+02:00 Heikki Linnakangas : > On 07/21/2015 10:38 AM, Pavel Stehule wrote: > >> where we are with this patch? Can I do some for it? >> > > I still feel this approach is misguided, and we should be tweaking psql > and/or libpq instead. I don't f

Re: [HACKERS] [PROPOSAL] VACUUM Progress Checker.

2015-07-24 Thread Pavel Stehule
? That would be > easy and cheap to track. It would result in some herky-jerky > "progress", but would still be an improvement over the feedback we don't > have now. > I like this idea. Regards Pavel > > -- > Josh Berkus > PostgreSQL Experts Inc. > ht

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-25 Thread Pavel Stehule
2015-07-21 16:58 GMT+02:00 Merlin Moncure : > On Tue, Jul 21, 2015 at 2:53 AM, Heikki Linnakangas > wrote: > > On 07/21/2015 10:38 AM, Pavel Stehule wrote: > >> > >> where we are with this patch? Can I do some for it? > > > > > > I still feel this

Re: [HACKERS] proposal: multiple psql option -c

2015-07-25 Thread Pavel Stehule
2015-07-23 17:52 GMT+02:00 Robert Haas : > On Fri, Jul 17, 2015 at 12:36 AM, Pavel Stehule > wrote: > >> Or just properly understand the ; ? > >> > >> -c "select * from foo; update bar set baz = 'bing'; vacuum bar;" > > > > there

Re: [HACKERS] proposal: multiple psql option -c

2015-07-25 Thread Pavel Stehule
2015-07-25 10:33 GMT+02:00 David G. Johnston : > On Saturday, July 25, 2015, Pavel Stehule wrote: >> >> 2015-07-23 17:52 GMT+02:00 Robert Haas : >> >>> On Fri, Jul 17, 2015 at 12:36 AM, Pavel Stehule >>> wrote: >>> >> Or just properly

Re: [HACKERS] pg_dump quietly ignore missing tables - is it bug?

2015-07-25 Thread Pavel Stehule
Hi I am sending a new patch - without checking wildcard chars. Regards Pavel 2015-07-23 7:22 GMT+02:00 Kyotaro HORIGUCHI : > Hello, > > > > 2015-07-19 20:54 GMT+02:00 Pavel Stehule : > > >> I am sending updated version. It implements new long option > > >&

Re: [HACKERS] raw output from copy

2015-07-25 Thread Pavel Stehule
2015-07-23 22:05 GMT+02:00 Dickson S. Guedes : > 2015-07-07 3:32 GMT-03:00 Pavel Stehule : > > > > Hi > > > > previous patch was broken, and buggy > > > > Here is new version with fixed upload and more tests > > > > The interesting is so I should

Re: [HACKERS] polymorphic types - enforce casting to most common type automatically

2015-07-25 Thread Pavel Stehule
2015-07-22 10:37 GMT+02:00 Heikki Linnakangas : > On 07/11/2015 12:19 AM, Pavel Stehule wrote: > >> 2015-07-10 18:43 GMT+02:00 Tom Lane : >> >> An example of what would presumably happen if we adopted this sort of >>> rule >>> (I've not checked

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-25 Thread Pavel Stehule
on libpq side than server side, but still it is enough - always, error, none. This patch is without documentation, but basic regress tests works. Regards Pavel 2015-07-25 10:01 GMT+02:00 Pavel Stehule : > > > 2015-07-21 16:58 GMT+02:00 Merlin Moncure : > >> On Tue, Jul 2

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-25 Thread Pavel Stehule
Hi here is complete patch, that introduce context filtering on client side. The core of this patch is trivial and small - almost all of size are trivial changes in regress tests - removing useless context. Documentation, check-world Regards Pavel 2015-07-26 0:42 GMT+02:00 Pavel Stehule

Re: [HACKERS] raw output from copy

2015-07-27 Thread Pavel Stehule
2015-07-27 10:41 GMT+02:00 Heikki Linnakangas : > On 07/27/2015 06:55 AM, Craig Ringer wrote: > >> On 7 July 2015 at 14:32, Pavel Stehule wrote: >> >>> Hi >>> >>> previous patch was broken, and buggy >>> >>> Here is new version wi

Re: [HACKERS] proposal: multiple psql option -c

2015-07-27 Thread Pavel Stehule
2015-07-27 20:32 GMT+02:00 Robert Haas : > On Sat, Jul 25, 2015 at 5:27 AM, Pavel Stehule > wrote: > > It will be nice side effect, but my primary problem was a impossibility > to > > combine VACUUM and any other statement to one simple psql call. > > Seems like yo

Re: [HACKERS] proposal: multiple psql option -c

2015-07-27 Thread Pavel Stehule
2015-07-27 20:47 GMT+02:00 Robert Haas : > On Mon, Jul 27, 2015 at 2:37 PM, Pavel Stehule > wrote: > > 2015-07-27 20:32 GMT+02:00 Robert Haas : > >> > >> On Sat, Jul 25, 2015 at 5:27 AM, Pavel Stehule > > >> wrote: > >> > It will be nice sid

Re: [HACKERS] proposal: multiple psql option -c

2015-07-27 Thread Pavel Stehule
2015-07-27 21:57 GMT+02:00 Andrew Dunstan : > > On 07/27/2015 02:53 PM, Pavel Stehule wrote: > >> >> >> >> >> I am trying to run parallel execution >> >> psql -At -c "select datname from pg_database" postgres | xargs -n 1 -P 3 >>

Re: [HACKERS] Autonomous Transaction is back

2015-07-27 Thread Pavel Stehule
egration with plpgsql can be secondary question. In this case I prefer a relation to block statement without possibility to explicit COMMIT. Minimally in functions. some like BEGIN BEGIN AUTONOMOUS ... END; END; This is consistent with current subtransaction support, and disallow some corn

Re: [HACKERS] proposal: multiple psql option -c

2015-07-27 Thread Pavel Stehule
2015-07-28 5:24 GMT+02:00 Pavel Stehule : > > > 2015-07-27 21:57 GMT+02:00 Andrew Dunstan : > >> >> On 07/27/2015 02:53 PM, Pavel Stehule wrote: >> >>> >>> >>> >>> >>> I am trying to run parallel execution >>> &

Re: [HACKERS] proposal: multiple psql option -c

2015-07-28 Thread Pavel Stehule
2015-07-28 10:43 GMT+02:00 Marc Mamin : > > > > > > >2015-07-28 5:24 GMT+02:00 Pavel Stehule : > > > >2015-07-27 21:57 GMT+02:00 Andrew Dunstan : > > > >On 07/27/2015 02:53 PM, Pavel Stehule wrote: > > > >I am trying

Re: [HACKERS] proposal: multiple psql option -c

2015-07-28 Thread Pavel Stehule
2015-07-28 15:16 GMT+02:00 Andrew Dunstan : > > On 07/28/2015 12:08 AM, Pavel Stehule wrote: > >> >> >> 2015-07-28 5:24 GMT+02:00 Pavel Stehule > pavel.steh...@gmail.com>>: >> >> >> >> 2015-07-27 21:57 GMT+02:00 Andrew Dunstan &g

Re: [HACKERS] Remaining 'needs review' patchs in July commitfest

2015-07-28 Thread Pavel Stehule
2015-07-28 21:51 GMT+02:00 Heikki Linnakangas : > 21 patches remain in Needs Review state, in the July commitfest. Some of > them have a reviewer signed up. I have highlighted some of them below that > worry me the most. What are we going to do about these? For each of them, > I'd like the authors

Re: [HACKERS] Remaining 'needs review' patchs in July commitfest

2015-07-29 Thread Pavel Golub
and, or as HL> a new psql backslash option. I did quick review for this, however I need some more time for tests. May be I will do it next week. There is a consensus, only detailed review needed. HL> -- HL> - Heikki -- With best wishes, Pavel mailto:p

Re: [HACKERS] proposal: multiple psql option -c

2015-07-29 Thread Pavel Stehule
Hi here is proof concept patch It should be cleaned, but it demonstrates a work well [pavel@localhost psql]$ ./psql -C 'select 10 x; select 20 y;' -C "\l" postgres x 10 (1 row) y 20 (1 row) List of databases Name|

Re: [HACKERS] raw output from copy

2015-08-06 Thread Pavel Stehule
napsal uživatel "Andrew Dunstan" : > > On 08/05/2015 04:59 PM, Heikki Linnakangas wrote: > >> On 07/27/2015 02:28 PM, Pavel Stehule wrote: >> >>> 2015-07-27 10:41 GMT+02:00 Heikki Linnakangas : >>> >>> What about input? This is a whole new

Re: [HACKERS] [patch] A \pivot command for psql

2015-08-10 Thread Pavel Stehule
hanks for the patch. > > This issue in this one as in the crosstab extension is that it's > available only if you are using some particular piece of extra > software, in this case the psql client. > > I'm working up a proposal to add (UN)PIVOT support to the bac

Re: [HACKERS] Precedence of standard comparison operators

2015-08-10 Thread Pavel Stehule
g a syntax error if you don't use > > parentheses is the preferable behavior here. > If we raise a syntax error, then there should be very informative message, because pattern true = 2 > 1 is probably relative often and it is hard to find syntax error on this trivial expression Regards Pavel > > I agree. > > > -- > Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-hackers >

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-08-10 Thread Pavel Stehule
2015-08-10 9:11 GMT+02:00 Heikki Linnakangas : > On 07/26/2015 08:34 AM, Pavel Stehule wrote: > >> Hi >> >> here is complete patch, that introduce context filtering on client side. >> The core of this patch is trivial and small - almost all of size are >&

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-08-12 Thread Pavel Stehule
2015-08-10 18:43 GMT+02:00 Pavel Stehule : > > > 2015-08-10 9:11 GMT+02:00 Heikki Linnakangas : > >> On 07/26/2015 08:34 AM, Pavel Stehule wrote: >> >>> Hi >>> >>> here is complete patch, that introduce context filtering on client side. >>&

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-08-12 Thread Pavel Stehule
2015-08-12 11:07 GMT+02:00 Marko Tiikkaja : > On 8/12/15 9:36 AM, Pavel Stehule wrote: > >> So, there is common agreement on this version. >> > > There are several instances of double semicolons. Also, > PsqlSettings.show_context doesn't look like a boolean to m

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-12 Thread Pavel Stehule
ow) > > Its natural habitat would be CHECK constraints, e.g: > > CHECK (count_nulls(a,b,c) IN (0, 3)) > > Will finish this up for the next CF, unless someone wants to tell me how > stupid this idea is before that. > It is not bad idea +1 Pavel > > .m > > >

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-12 Thread Pavel Stehule
2015-08-12 19:32 GMT+02:00 Peter Geoghegan : > On Wed, Aug 12, 2015 at 10:30 AM, Alvaro Herrera > wrote: > > The name count_nulls() suggest an aggregate function to me, though. > > I thought the same. > maybe nulls_count ? we have regr_count already Regards Pavel >

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-12 Thread Pavel Stehule
2015-08-12 19:37 GMT+02:00 Marko Tiikkaja : > On 2015-08-12 7:35 PM, Pavel Stehule wrote: > >> maybe nulls_count ? >> >> we have regr_count already >> > > But that's an aggregate as well.. > my mistake Pavel > > > .m >

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-08-12 Thread Pavel Stehule
Hi 2015-08-12 11:07 GMT+02:00 Marko Tiikkaja : > On 8/12/15 9:36 AM, Pavel Stehule wrote: > >> So, there is common agreement on this version. >> > > There are several instances of double semicolons. Also, > PsqlSettings.show_context doesn't look like a boolea

Re: [HACKERS] pg_dump quietly ignore missing tables - is it bug?

2015-08-13 Thread Pavel Stehule
Hi 2015-07-30 12:44 GMT+02:00 Heikki Linnakangas : > On 07/25/2015 07:08 PM, Pavel Stehule wrote: > >> I am sending a new patch - without checking wildcard chars. >> > > The documentation says the option is called --strict-names, while the code > has --strict-mode.

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-13 Thread Pavel Stehule
2015-08-13 9:21 GMT+02:00 Marko Tiikkaja : > On 8/13/15 9:18 AM, Shulgin, Oleksandr wrote: > >> nnulls() >> > > I think I'd prefer num_nulls() over that. > can be what about similar twin function num_nonulls()? Pavel > > > .m > > > > --

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-08-13 Thread Pavel Stehule
2015-08-13 9:47 GMT+02:00 Shulgin, Oleksandr : > On Thu, Aug 13, 2015 at 9:25 AM, Pavel Stehule > wrote: > >> >> >> 2015-08-13 9:21 GMT+02:00 Marko Tiikkaja : >> >>> On 8/13/15 9:18 AM, Shulgin, Oleksandr wrote: >>> >>>>

Re: [HACKERS] pg_dump quietly ignore missing tables - is it bug?

2015-08-13 Thread Pavel Stehule
Hi I am sending updated version news: * strict-names everywhere * checking table names in pg_dump simplified - not necessary to create single query * pg_restore support Regards Pavel 2015-08-13 9:17 GMT+02:00 Pavel Stehule : > Hi > > 2015-07-30 12:44 GMT+02:00 Heikki Linnakangas

Re: [HACKERS] Error message with plpgsql CONTINUE

2015-08-16 Thread Pavel Stehule
ow that. I'm not sure about err_text though. Also, the code treats > PLPGSQL_RC_OK and PLPGSQL_RC_EXIT the same, which seems like a bug; I would > think PLPGSQL_RC_EXIT should be handled the same way as CONTINUE. > > If someone can confirm this and tell me what to do about err_t

Re: [HACKERS] jsonb array-style subscripting

2015-08-17 Thread Pavel Stehule
; should be better than '[]' ? The lot of modern languages doesn't different between arrays and hash. Regards Pavel > > I'm not sure having the UPDATE you show cause objects to spring to life is > so great either. > -- > Jim Nasby, Data Architect, Blue Treble Consul

Re: [HACKERS] Colon Omitted From pgSQL Assignments

2015-08-18 Thread Pavel Stehule
s for these cases and for GET * DIAGNOSTICS, so we support both. FOR and OPEN only support :=. Personally I am thinking, so this design is unhappy, but at the end this is small problem not too important to solve. Regards Pavel > > I am not aware of any problems due to this. I suppose

Re: [HACKERS] Error message with plpgsql CONTINUE

2015-08-18 Thread Pavel Stehule
in LABEL items.) > > You likely do need to split opt_block_label into two productions, since > that will be the easiest way to pass forward the knowledge of whether > it's being called from a loop or non-loop construct. > when I implemented this check in plpgsql_check I found an

[HACKERS] proposal: function parse_ident

2015-08-18 Thread Pavel Stehule
: SELECT parse_ident('"some schema".tablename'); Comments, ideas, notes? Regards Pavel

Re: [HACKERS] proposal: function parse_ident

2015-08-19 Thread Pavel Stehule
Hi 2015-08-19 21:33 GMT+02:00 Tom Lane : > Pavel Stehule writes: > > I miss a functionality that helps with parsing any identifier to basic > > three parts - database, schema, objectname. We have this function > > internally, but it is not available for SQL layer. > >

Re: [HACKERS] proposal: function parse_ident

2015-08-20 Thread Pavel Stehule
eems a bit arbitrary > to me to throw an error in one case but not the other. > When I would to work with living object, then behave of cast to regclass is correct, but I can work with object, that will be created in future, and I need to take some other information about this future object - and then cast has to fail. Regards Pavel > > regards, tom lane >

Re: [HACKERS] proposal: contrib module - generic command scheduler

2015-08-20 Thread Pavel Stehule
Hi 2015-08-20 16:42 GMT+02:00 Alvaro Herrera : > Pavel Stehule wrote: > > Hi, > > > Job schedulers are important and sometimes very complex part of any > > software. PostgreSQL miss it. I propose new contrib module, that can be > > used simply for some tasks, an

Re: [HACKERS] proposal: function parse_ident

2015-08-20 Thread Pavel Stehule
is *parse*_ident(). It's not > meant to guarantee an object actually exists, what kind of object it is, or > whether it's syntactically correct. It's meant only to separate an > identifier into it's 3 (or in some cases 2) components. If this was as > simple as stri

Re: [HACKERS] pg_dump quietly ignore missing tables - is it bug?

2015-08-23 Thread Pavel Stehule
> > Rewrite: > This option has no effect on -N/--exclude-schema, -T/--exclude_table or > --exclude-table-date. An exclude pattern failing to match any objects is > not considered an error. > > fixed Regards Pavel > The new status of this patch is: Waiting on Author >

Re: [HACKERS] proposal: function parse_ident

2015-08-23 Thread Pavel Stehule
Hi 2015-08-21 7:15 GMT+02:00 Pavel Stehule : > > > 2015-08-20 21:16 GMT+02:00 Jim Nasby : > >> On 8/19/15 7:22 PM, Tom Lane wrote: >> >>> Jim Nasby writes: >>> >>>> Don't say "parse names for things other than tables". On

[HACKERS] psql - better support pipe line

2015-08-23 Thread Pavel Stehule
ly - but the line xargs -P 3 -I % sh -c "psql % -q -c 'analyze pg_attribute'; echo %" is little bit ugly - with some psql option it can be cleaned to xargs -P3 -I % psql % -q --echo-db -c "analyze pg_attribute" | ... --echo-db requires -q option What are you thinking about this idea? Regards Pavel

Re: [HACKERS] psql - better support pipe line

2015-08-24 Thread Pavel Stehule
2015-08-24 12:49 GMT+02:00 Heikki Linnakangas : > On 08/24/2015 08:06 AM, Pavel Stehule wrote: > >> Hi >> >> I found so a set "psql" and "xargs" is pretty strong. But I miss a psql >> option for simple returning current database and continu

Re: [HACKERS] psql - better support pipe line

2015-08-24 Thread Pavel Stehule
2015-08-24 16:02 GMT+02:00 Tom Lane : > Heikki Linnakangas writes: > > On 08/24/2015 08:06 AM, Pavel Stehule wrote: > >> it works perfectly - but the line > >> xargs -P 3 -I % sh -c "psql % -q -c 'analyze pg_attribute'; echo %" > >> is litt

Re: [HACKERS] proposal: multiple psql option -c

2015-08-26 Thread Pavel Stehule
Hi 2015-07-29 21:05 GMT+02:00 Pavel Stehule : > Hi > > here is proof concept patch > > It should be cleaned, but it demonstrates a work well > > [pavel@localhost psql]$ ./psql -C 'select 10 x; select 20 y;' -C "\l" > postgres > x >

Re: [HACKERS] proposal: multiple psql option -c

2015-08-26 Thread Pavel Stehule
other example related to using psql in pipeline [pavel@localhost psql]$ ./psql postgres -q -g "vacuum analyze pg_attribute" -g "\echo :DBNAME" postgres

[HACKERS] strange test in psql:startup.c

2015-08-26 Thread Pavel Stehule
on should be probably only? options.single_txn && options.action == ACT_NOTHING) Regards Pavel

Re: [HACKERS] proposal: multiple psql option -c

2015-08-26 Thread Pavel Stehule
Hi 2015-08-26 13:12 GMT+02:00 Pavel Stehule : > Hi > > 2015-07-29 21:05 GMT+02:00 Pavel Stehule : > >> Hi >> >> here is proof concept patch >> >> It should be cleaned, but it demonstrates a work well >> >> [pavel@localhost psql]$ ./psql -C

Re: [HACKERS] psql - better support pipe line

2015-08-26 Thread Pavel Stehule
Hi 2015-08-25 17:21 GMT+02:00 Tom Lane : > Jim Nasby writes: > > What I've had problems with is trying to correlate psql specified > > connection attributes with things like DBI. It would be nice if there > > was a way to get a fully formed connection URI for the current > connection. > > Yeah,

Re: [HACKERS] psql - better support pipe line

2015-08-27 Thread Pavel Stehule
2015-08-27 11:54 GMT+02:00 Shulgin, Oleksandr : > > > On Wed, Aug 26, 2015 at 5:44 PM, Pavel Stehule > wrote: > >> Hi >> >> 2015-08-25 17:21 GMT+02:00 Tom Lane : >> >>> Jim Nasby writes: >>> > What I've had problems with is tr

Re: [HACKERS] psql - better support pipe line

2015-08-27 Thread Pavel Stehule
2015-08-27 11:54 GMT+02:00 Shulgin, Oleksandr : > > > On Wed, Aug 26, 2015 at 5:44 PM, Pavel Stehule > wrote: > >> Hi >> >> 2015-08-25 17:21 GMT+02:00 Tom Lane : >> >>> Jim Nasby writes: >>> > What I've had problems with is tr

Re: [HACKERS] proposal: multiple psql option -c

2015-08-28 Thread Pavel Stehule
2015-08-28 22:07 GMT+02:00 Jim Nasby : > On 8/26/15 8:15 AM, Pavel Stehule wrote: > >> + and then exit. This is useful in shell scripts. Start-up files >> + (psqlrc and ~/.psqlrc) >> are >> + ignored with this option. >> > > Sorry if this

Re: [HACKERS] [patch] Proposal for \rotate in psql

2015-08-28 Thread Pavel Stehule
23 +| performance 71 | > | | hackers 2043 | | > +-+---+-------+ > > As there are several rows that match the vertical/horizontal filter, > (for example 3 results for 2014-06 as row and "arro

Re: [HACKERS] proposal: multiple psql option -c

2015-08-28 Thread Pavel Stehule
user rc file. >> > > If we had a \i variation that didn't fail if the file wasn't readable you > could use that to pull a system psqlrc in from your custom one. The import any file is not problem with -g command - so special option is not necessary probably psql postgr

Re: [HACKERS] proposal: multiple psql option -c

2015-08-28 Thread Pavel Stehule
2015-08-28 22:31 GMT+02:00 David G. Johnston : > On Fri, Aug 28, 2015 at 4:18 PM, Pavel Stehule > wrote: > >> >> >> 2015-08-28 22:07 GMT+02:00 Jim Nasby : >> >>> On 8/26/15 8:15 AM, Pavel Stehule wrote: >>> >>>> +

[HACKERS] to_json(NULL) should to return JSON null instead NULL

2015-08-28 Thread Pavel Stehule
'null' is null; ┌──┐ │ ?column? │ ╞══╡ │ f│ └──┘ (1 row) ? Regards see: http://stackoverflow.com/questions/32283125/why-cant-null-be-converted-to-jsons-null-in-postgresql http://stackoverflow.com/questions/21120999/representing-null-in-json Pavel

Re: [HACKERS] to_json(NULL) should to return JSON null instead NULL

2015-08-29 Thread Pavel Stehule
gt; >> [1,null,2] >> (1 row) >> >> The scalar case is definitely failing to be consistent with these. >> > > Yes, that's my argument for correctness also: to_json() on a composite > object should behave like distribution of to_json() calls over object/array > elements. > > >> Is consistency a sufficient reason to change it? >> > > Not for me. > It is bug - and it should be fixed. I agree, so this change is too strong for fixing in minor version - but we can change it in unreleased major versions - 9.5 and master. Regards Pavel > > -- > Alex > >

Re: [HACKERS] On-demand running query plans using auto_explain and signals

2015-08-29 Thread Pavel Stehule
gt; > Good point. There's still hope to set a flag and process it later on. > Will have to check if it's possible to stay in the scope of a loaded module > though. > I had a workable prototype - and It was implemented very similar as handling CANCEL Pavel

Re: [HACKERS] to_json(NULL) should to return JSON null instead NULL

2015-08-29 Thread Pavel Stehule
2015-08-29 19:11 GMT+02:00 Andrew Dunstan : > > > On 08/29/2015 12:02 PM, Pavel Stehule wrote: > >> >> >> 2015-08-29 15:43 GMT+02:00 Shulgin, Oleksandr < >> oleksandr.shul...@zalando.de <mailto:oleksandr.shul...@zalando.de>>: >> >>

Re: [HACKERS] On-demand running query plans using auto_explain and signals

2015-08-29 Thread Pavel Stehule
2015-08-29 18:36 GMT+02:00 Andres Freund : > On 2015-08-29 18:27:59 +0200, Pavel Stehule wrote: > > 2015-08-29 18:25 GMT+02:00 Shulgin, Oleksandr < > oleksandr.shul...@zalando.de> > > > Good point. There's still hope to set a flag and process it later on.

Re: [HACKERS] to_json(NULL) should to return JSON null instead NULL

2015-08-29 Thread Pavel Stehule
2015-08-29 22:06 GMT+02:00 Jim Nasby : > On 8/29/15 12:29 PM, Pavel Stehule wrote: > >> Note that all the to_json functions are strict. In this sense it's >> quite consistent. If we change it to being called on null input, >> what should we return if a

Re: [HACKERS] [PATCH] SQL function to report log message

2015-08-29 Thread Pavel Stehule
CREATE OR REPLACE FUNCTION pg_catalog.pg_report_log(text, text, boolean) RETURNS void LANGUAGE internal IMMUTABLE STRICT AS $function$pg_report_log$function$ Why stable, why immutable? This function should be volatile. 6. using elog level enum as errcode is wrong idea - errcodes are defined in table http://www.postgresql.org/docs/9.4/static/errcodes-appendix.html Regards Pavel > > Regards, > Dinesh > manojadinesh.blogspot.com >

Re: [HACKERS] to_json(NULL) should to return JSON null instead NULL

2015-08-29 Thread Pavel Stehule
2015-08-30 4:57 GMT+02:00 Andrew Dunstan : > > > On 08/29/2015 04:27 PM, Tom Lane wrote: > >> Jim Nasby writes: >> >>> On 8/29/15 12:29 PM, Pavel Stehule wrote: >>> >>>> what is correct from JSON perspective? All fields with NULL >>

Re: [HACKERS] On-demand running query plans using auto_explain and signals

2015-08-30 Thread Pavel Stehule
2015-08-30 10:30 GMT+02:00 Shulgin, Oleksandr : > On Aug 29, 2015 7:31 PM, "Pavel Stehule" wrote: > > > > > > > > 2015-08-29 18:36 GMT+02:00 Andres Freund : > >> > >> On 2015-08-29 18:27:59 +0200, Pavel Stehule wrote: > >> &g

Re: [HACKERS] On-demand running query plans using auto_explain and signals

2015-08-30 Thread Pavel Stehule
2015-08-30 10:34 GMT+02:00 Pavel Stehule : > > > 2015-08-30 10:30 GMT+02:00 Shulgin, Oleksandr < > oleksandr.shul...@zalando.de>: > >> On Aug 29, 2015 7:31 PM, "Pavel Stehule" wrote: >> > >> > >> > >> > 2015-08-29 18:36

Re: [HACKERS] On-demand running query plans using auto_explain and signals

2015-08-31 Thread Pavel Stehule
2015-08-31 11:30 GMT+02:00 Shulgin, Oleksandr : > Do you still have the code somewhere around? Did it see production use? >>> I sent it to mailing list year ago >> >> >> http://www.postgresql.org/message-id/cafj8praxcs9b8abgim-zauvggqdhpzoarz5ysp1_nhv9hp8...@mail.gmail.com >> > > Ah, thanks!

Re: [HACKERS] [patch] Proposal for \rotate in psql

2015-08-31 Thread Pavel Stehule
2015-08-29 5:57 GMT+02:00 Pavel Stehule : > > > 2015-08-29 0:48 GMT+02:00 Daniel Verite : > >> Hi, >> >> This is a reboot of my previous proposal for pivoting results in psql, >> with a new patch that generalizes the idea further through a command >

[HACKERS] Better detection of staled postmaster.pid

2015-08-31 Thread Pavel Raiskup
at.com/show_bug.cgi?id=1257334 Pavel -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] [PATCH] SQL function to report log message

2015-08-31 Thread Pavel Stehule
2015-08-31 20:43 GMT+02:00 dinesh kumar : > Hi, > > On Sat, Aug 29, 2015 at 4:22 PM, Pavel Stehule > wrote: > >> Hi >> >> I am starting to work review of this patch >> >> 2015-07-13 9:54 GMT+02:00 dinesh kumar : >> >>> Hi All, >>&

Re: [HACKERS] [PATCH] SQL function to report log message

2015-08-31 Thread Pavel Stehule
2015-09-01 6:59 GMT+02:00 Pavel Stehule : > > > 2015-08-31 20:43 GMT+02:00 dinesh kumar : > >> Hi, >> >> On Sat, Aug 29, 2015 at 4:22 PM, Pavel Stehule >> wrote: >> >>> Hi >>> >>> I am starting to work review of this p

Re: [HACKERS] On-demand running query plans using auto_explain and signals

2015-08-31 Thread Pavel Stehule
Hi 2015-08-31 19:09 GMT+02:00 Shulgin, Oleksandr : > On Mon, Aug 31, 2015 at 12:35 PM, Pavel Stehule > wrote: > >> >>>> >>>> http://www.postgresql.org/message-id/cafj8praxcs9b8abgim-zauvggqdhpzoarz5ysp1_nhv9hp8...@mail.gmail.com >>>> >&

Re: [HACKERS] [PATCH] SQL function to report log message

2015-08-31 Thread Pavel Stehule
2015-09-01 7:20 GMT+02:00 Jim Nasby : > On 8/31/15 11:59 PM, Pavel Stehule wrote: > >> The transformation: text -> error level is common task - and PLpgSQL it >> does in pl_gram.y. My idea is to add new function to error utils named >> "parse_error_level"

<    4   5   6   7   8   9   10   11   12   13   >