Re: pgsql: Implement jsonpath .datetime() method

2019-10-12 Thread Tom Lane
Alexander Korotkov  writes:
> This patch also changes the way timestamp to timestamptz cast works.
> Previously it did timestamp2tm() then tm2timestamp().  Instead, after
> timestamp2tm() it calculates timezone offset and applies it to
> original timestamp value.  I hope this is correct.

I'd wonder whether this gives the same answers near DST transitions,
where it's not real clear which offset applies.

Please *don't* wrap this sort of thing into an unrelated feature patch.

regards, tom lane




Re: pgsql: Implement jsonpath .datetime() method

2019-10-12 Thread Alexander Korotkov
On Thu, Oct 3, 2019 at 4:48 PM Robert Haas  wrote:
> On Tue, Oct 1, 2019 at 1:41 PM Alexander Korotkov
>  wrote:
> > So, basically standard requires us to suppress any error happening in
> > filter expression.
>
> Sounds like the standard is dumb, then. :-)
>
> > But as I wrote before suppression of errors in
> > datetime comparison may lead to surprising results.  That happens in
> > rare corner cases, but still.  This makes uneasy choice between
> > consistent behavior and standard behavior.
>
> Yeah.

Proposed patch eliminates this dilemma in particular case.  It
provides correct cross-type comparison of datetime values even if one
of values overflows during cast.  In order to do this, I made cast
functions to report whether lower or upper boundary is overflowed.  We
know that overflowed value is lower (or upper) than any valid value
except infinity.

This patch also changes the way timestamp to timestamptz cast works.
Previously it did timestamp2tm() then tm2timestamp().  Instead, after
timestamp2tm() it calculates timezone offset and applies it to
original timestamp value.  I hope this is correct.  If so, besides
making overflow handling easier, this refactoring saves some CPU
cycles.

--
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


0002-Refactor-jsonpath-s-compareDatetime-2.patch
Description: Binary data


pgsql: Fix use of term "verifier"

2019-10-12 Thread Peter Eisentraut
Fix use of term "verifier"

Within the context of SCRAM, "verifier" has a specific meaning in the
protocol, per RFCs.  The existing code used "verifier" differently, to
mean whatever is or would be stored in pg_auth.rolpassword.

Fix this by using the term "secret" for this, following RFC 5803.

Reviewed-by: Michael Paquier 
Discussion: 
https://www.postgresql.org/message-id/flat/be397b06-6e4b-ba71-c7fb-54cae84a7e18%402ndquadrant.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/b4675a8ae2d0aaafeb136c46c92bb56eaf018d32

Modified Files
--
src/backend/libpq/auth-scram.c| 104 +++---
src/backend/libpq/auth.c  |   2 +-
src/backend/libpq/crypt.c |   8 +--
src/common/scram-common.c |   4 +-
src/include/common/scram-common.h |   6 +-
src/include/libpq/crypt.h |   2 +-
src/include/libpq/scram.h |   8 +--
src/interfaces/libpq/fe-auth-scram.c  |   6 +-
src/interfaces/libpq/fe-auth.c|   2 +-
src/interfaces/libpq/fe-auth.h|   2 +-
src/test/authentication/t/001_password.pl |   2 +-
src/test/regress/expected/password.out|  12 ++--
src/test/regress/sql/password.sql |  12 ++--
13 files changed, 85 insertions(+), 85 deletions(-)



pgsql: AIX: Stop adding option -qsrcmsg.

2019-10-12 Thread Noah Misch
AIX: Stop adding option -qsrcmsg.

With xlc v16.1.0, it causes internal compiler errors.  With xlc versions
not exhibiting that bug, removing -qsrcmsg merely changes the compiler
error reporting format.  Back-patch to 9.4 (all supported versions).

Discussion: https://postgr.es/m/20191003064105.ga3955...@rfd.leadboat.com

Branch
--
REL_11_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/e5b4926ef6110ef4f21c197d462097072d38b39d

Modified Files
--
src/template/aix | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)



pgsql: AIX: Stop adding option -qsrcmsg.

2019-10-12 Thread Noah Misch
AIX: Stop adding option -qsrcmsg.

With xlc v16.1.0, it causes internal compiler errors.  With xlc versions
not exhibiting that bug, removing -qsrcmsg merely changes the compiler
error reporting format.  Back-patch to 9.4 (all supported versions).

Discussion: https://postgr.es/m/20191003064105.ga3955...@rfd.leadboat.com

Branch
--
REL9_6_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/c73f4f680e40d8e43f9e5c9a5252094e0589b9d3

Modified Files
--
src/template/aix | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)



pgsql: AIX: Stop adding option -qsrcmsg.

2019-10-12 Thread Noah Misch
AIX: Stop adding option -qsrcmsg.

With xlc v16.1.0, it causes internal compiler errors.  With xlc versions
not exhibiting that bug, removing -qsrcmsg merely changes the compiler
error reporting format.  Back-patch to 9.4 (all supported versions).

Discussion: https://postgr.es/m/20191003064105.ga3955...@rfd.leadboat.com

Branch
--
REL_12_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/3fb14cfcbd7999d71a7a5d83ffcbeee08c5228db

Modified Files
--
src/template/aix | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)



pgsql: AIX: Stop adding option -qsrcmsg.

2019-10-12 Thread Noah Misch
AIX: Stop adding option -qsrcmsg.

With xlc v16.1.0, it causes internal compiler errors.  With xlc versions
not exhibiting that bug, removing -qsrcmsg merely changes the compiler
error reporting format.  Back-patch to 9.4 (all supported versions).

Discussion: https://postgr.es/m/20191003064105.ga3955...@rfd.leadboat.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/5f3d271d03b249f5c80e3d3ca946f62a33d7862f

Modified Files
--
src/template/aix | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)



pgsql: AIX: Stop adding option -qsrcmsg.

2019-10-12 Thread Noah Misch
AIX: Stop adding option -qsrcmsg.

With xlc v16.1.0, it causes internal compiler errors.  With xlc versions
not exhibiting that bug, removing -qsrcmsg merely changes the compiler
error reporting format.  Back-patch to 9.4 (all supported versions).

Discussion: https://postgr.es/m/20191003064105.ga3955...@rfd.leadboat.com

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/77cc4a5957d03cdf082e7a75648273c008f3f25f

Modified Files
--
src/template/aix | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)



pgsql: AIX: Stop adding option -qsrcmsg.

2019-10-12 Thread Noah Misch
AIX: Stop adding option -qsrcmsg.

With xlc v16.1.0, it causes internal compiler errors.  With xlc versions
not exhibiting that bug, removing -qsrcmsg merely changes the compiler
error reporting format.  Back-patch to 9.4 (all supported versions).

Discussion: https://postgr.es/m/20191003064105.ga3955...@rfd.leadboat.com

Branch
--
REL9_5_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/e40eb31c0d9b8b6719d01c32201f8c8a6a12566b

Modified Files
--
src/template/aix | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)



pgsql: AIX: Stop adding option -qsrcmsg.

2019-10-12 Thread Noah Misch
AIX: Stop adding option -qsrcmsg.

With xlc v16.1.0, it causes internal compiler errors.  With xlc versions
not exhibiting that bug, removing -qsrcmsg merely changes the compiler
error reporting format.  Back-patch to 9.4 (all supported versions).

Discussion: https://postgr.es/m/20191003064105.ga3955...@rfd.leadboat.com

Branch
--
REL9_4_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/b705582b480054348cdc34c106340be00450720a

Modified Files
--
src/template/aix | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)