public inbox for [email protected]help / color / mirror / Atom feed
[PATCH 1/2] Make xact.h usable in frontend. 20+ messages / 2 participants [nested] [flat]
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* [PATCH 1/2] Make xact.h usable in frontend. @ 2020-08-12 20:07 Heikki Linnakangas <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Heikki Linnakangas @ 2020-08-12 20:07 UTC (permalink / raw) xact.h included utils/datetime.h, which cannot be used in the frontend (it includes fmgr.h, which needs Datum). But xact.h only needs the definition of TimestampTz from it, which is available directly in datatypes/timestamp.h. Change xact.h to include that instead of utils/datetime.h, so that it can be used in client programs. --- src/backend/nodes/params.c | 1 + src/backend/utils/time/snapmgr.c | 2 ++ src/include/access/xact.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 1719119fc28..bce0c7e72b2 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -16,6 +16,7 @@ #include "postgres.h" #include "access/xact.h" +#include "fmgr.h" #include "mb/stringinfo_mb.h" #include "nodes/params.h" #include "parser/parse_node.h" diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6b6c8571e23..02b51bc4fe0 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -53,6 +53,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "datatype/timestamp.h" #include "lib/pairingheap.h" #include "miscadmin.h" #include "storage/predicate.h" @@ -67,6 +68,7 @@ #include "utils/resowner_private.h" #include "utils/snapmgr.h" #include "utils/syscache.h" +#include "utils/timestamp.h" /* diff --git a/src/include/access/xact.h b/src/include/access/xact.h index c18554bae2c..9f9dc7d3354 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -16,11 +16,11 @@ #include "access/transam.h" #include "access/xlogreader.h" +#include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -#include "utils/datetime.h" /* * Maximum size of Global Transaction ID (including '\0'). -- 2.20.1 --------------2C164649926A2BC8A5FD8CB8 Content-Type: text/x-patch; charset=UTF-8; name="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-commit-and-abort-WAL-records-with-XLR_SPECIAL_R.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 20+ messages in thread
* Docs: Order of json aggregate functions @ 2024-06-19 17:49 Wolfgang Walther <[email protected]> 0 siblings, 0 replies; 20+ messages in thread From: Wolfgang Walther @ 2024-06-19 17:49 UTC (permalink / raw) To: PostgreSQL Hackers <[email protected]> The order of json related aggregate functions in the docs is currently like this: [...] json_agg json_objectagg json_object_agg json_object_agg_strict json_object_agg_unique json_arrayagg json_object_agg_unique_strict max min range_agg range_intersect_agg json_agg_strict [...] json_arrayagg and json_agg_strict are out of place. Attached patch puts them in the right spot. This is the same down to v16. Best, Wolfgang Attachments: [text/x-patch] v1-0001-Fix-order-of-json-aggregate-functions-in-docs.patch (5.5K, ../../[email protected]/2-v1-0001-Fix-order-of-json-aggregate-functions-in-docs.patch) download | inline diff: From ad857a824d893a3e421c6c577c1215f71c1ebfe3 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther <[email protected]> Date: Wed, 19 Jun 2024 19:40:49 +0200 Subject: [PATCH v1] Fix order of json aggregate functions in docs --- doc/src/sgml/func.sgml | 96 +++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 2609269610b..c3b342d832f 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -21790,6 +21790,54 @@ SELECT NULLIF(value, '(none)') ... <entry>No</entry> </row> + <row> + <entry role="func_table_entry"><para role="func_signature"> + <indexterm> + <primary>json_agg_strict</primary> + </indexterm> + <function>json_agg_strict</function> ( <type>anyelement</type> ) + <returnvalue>json</returnvalue> + </para> + <para role="func_signature"> + <indexterm> + <primary>jsonb_agg_strict</primary> + </indexterm> + <function>jsonb_agg_strict</function> ( <type>anyelement</type> ) + <returnvalue>jsonb</returnvalue> + </para> + <para> + Collects all the input values, skipping nulls, into a JSON array. + Values are converted to JSON as per <function>to_json</function> + or <function>to_jsonb</function>. + </para></entry> + <entry>No</entry> + </row> + + <row> + <entry role="func_table_entry"><para role="func_signature"> + <indexterm><primary>json_arrayagg</primary></indexterm> + <function>json_arrayagg</function> ( + <optional> <replaceable>value_expression</replaceable> </optional> + <optional> <literal>ORDER BY</literal> <replaceable>sort_expression</replaceable> </optional> + <optional> { <literal>NULL</literal> | <literal>ABSENT</literal> } <literal>ON NULL</literal> </optional> + <optional> <literal>RETURNING</literal> <replaceable>data_type</replaceable> <optional> <literal>FORMAT JSON</literal> <optional> <literal>ENCODING UTF8</literal> </optional> </optional> </optional>) + </para> + <para> + Behaves in the same way as <function>json_array</function> + but as an aggregate function so it only takes one + <replaceable>value_expression</replaceable> parameter. + If <literal>ABSENT ON NULL</literal> is specified, any NULL + values are omitted. + If <literal>ORDER BY</literal> is specified, the elements will + appear in the array in that order rather than in the input order. + </para> + <para> + <literal>SELECT json_arrayagg(v) FROM (VALUES(2),(1)) t(v)</literal> + <returnvalue>[2, 1]</returnvalue> + </para></entry> + <entry>No</entry> + </row> + <row> <entry role="func_table_entry"><para role="func_signature"> <indexterm><primary>json_objectagg</primary></indexterm> @@ -21900,31 +21948,6 @@ SELECT NULLIF(value, '(none)') ... <entry>No</entry> </row> - <row> - <entry role="func_table_entry"><para role="func_signature"> - <indexterm><primary>json_arrayagg</primary></indexterm> - <function>json_arrayagg</function> ( - <optional> <replaceable>value_expression</replaceable> </optional> - <optional> <literal>ORDER BY</literal> <replaceable>sort_expression</replaceable> </optional> - <optional> { <literal>NULL</literal> | <literal>ABSENT</literal> } <literal>ON NULL</literal> </optional> - <optional> <literal>RETURNING</literal> <replaceable>data_type</replaceable> <optional> <literal>FORMAT JSON</literal> <optional> <literal>ENCODING UTF8</literal> </optional> </optional> </optional>) - </para> - <para> - Behaves in the same way as <function>json_array</function> - but as an aggregate function so it only takes one - <replaceable>value_expression</replaceable> parameter. - If <literal>ABSENT ON NULL</literal> is specified, any NULL - values are omitted. - If <literal>ORDER BY</literal> is specified, the elements will - appear in the array in that order rather than in the input order. - </para> - <para> - <literal>SELECT json_arrayagg(v) FROM (VALUES(2),(1)) t(v)</literal> - <returnvalue>[2, 1]</returnvalue> - </para></entry> - <entry>No</entry> - </row> - <row> <entry role="func_table_entry"><para role="func_signature"> <indexterm> @@ -22033,29 +22056,6 @@ SELECT NULLIF(value, '(none)') ... <entry>No</entry> </row> - <row> - <entry role="func_table_entry"><para role="func_signature"> - <indexterm> - <primary>json_agg_strict</primary> - </indexterm> - <function>json_agg_strict</function> ( <type>anyelement</type> ) - <returnvalue>json</returnvalue> - </para> - <para role="func_signature"> - <indexterm> - <primary>jsonb_agg_strict</primary> - </indexterm> - <function>jsonb_agg_strict</function> ( <type>anyelement</type> ) - <returnvalue>jsonb</returnvalue> - </para> - <para> - Collects all the input values, skipping nulls, into a JSON array. - Values are converted to JSON as per <function>to_json</function> - or <function>to_jsonb</function>. - </para></entry> - <entry>No</entry> - </row> - <row> <entry role="func_table_entry"><para role="func_signature"> <indexterm> -- 2.45.1 ^ permalink raw reply [nested|flat] 20+ messages in thread
end of thread, other threads:[~2024-06-19 17:49 UTC | newest] Thread overview: 20+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2020-08-12 20:07 [PATCH 1/2] Make xact.h usable in frontend. Heikki Linnakangas <[email protected]> 2024-06-19 17:49 Docs: Order of json aggregate functions Wolfgang Walther <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox