summaryrefslogtreecommitdiff
path: root/databases/tablelog/files/patch-table__log.c
blob: 6a043b4542d4b966c4ecfffa7261521ceb7081ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--- table_log.c.orig	2007-05-16 23:14:04 UTC
+++ table_log.c
@@ -22,6 +22,8 @@
 #include "utils/formatting.h"
 #include "utils/builtins.h"
 #include <utils/lsyscache.h>
+#include <utils/rel.h>
+#include <utils/timestamp.h>
 #include <funcapi.h>
 
 /* for PostgreSQL >= 8.2.x */
@@ -71,7 +73,11 @@ int count_columns (TupleDesc tupleDesc) {
   int i;
 
   for (i = 0; i < tupleDesc->natts; ++i) {
+#if PG_VERSION_NUM < 110000
     if (!tupleDesc->attrs[i]->attisdropped) {
+#else
+    if (!tupleDesc->attrs[i].attisdropped) {
+#endif
       ++count;
     }
   }
@@ -298,7 +304,11 @@ static void __table_log (TriggerData *trigdata, char *
     col_nr++;
     found_col = 0;
     do {
+#if PG_VERSION_NUM < 110000
       if (trigdata->tg_relation->rd_att->attrs[col_nr - 1]->attisdropped) {
+#else
+      if (trigdata->tg_relation->rd_att->attrs[col_nr - 1].attisdropped) {
+#endif
         /* this column is dropped, skip it */
         col_nr++;
         continue;
@@ -343,7 +353,11 @@ static void __table_log (TriggerData *trigdata, char *
     col_nr++;
     found_col = 0;
     do {
+#if PG_VERSION_NUM < 110000
       if (trigdata->tg_relation->rd_att->attrs[col_nr - 1]->attisdropped) {
+#else
+      if (trigdata->tg_relation->rd_att->attrs[col_nr - 1].attisdropped) {
+#endif
         /* this column is dropped, skip it */
         col_nr++;
         continue;
@@ -370,7 +384,11 @@ static void __table_log (TriggerData *trigdata, char *
     col_nr++;
     found_col = 0;
     do {
+#if PG_VERSION_NUM < 110000
       if (trigdata->tg_relation->rd_att->attrs[col_nr - 1]->attisdropped) {
+#else
+      if (trigdata->tg_relation->rd_att->attrs[col_nr - 1].attisdropped) {
+#endif
         /* this column is dropped, skip it */
         col_nr++;
         continue;