Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7884517

Browse files
committed
findoidjoins was suffering from bit rot (pginterface no
longer in expected location).
1 parentfa5400c commit7884517

File tree

3 files changed

+26
-19
lines changed

3 files changed

+26
-19
lines changed

‎contrib/findoidjoins/Makefile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
#
2-
# Makefile, requirespgsql/contrib/pginterface
2+
# Makefile, requiressrc/interfaces/libpgeasy
33
#
44
#
5-
PGINTERFACE = ../pginterface/pginterface.o ../pginterface/halt.o# these have to be in your library search path
5+
INSTALLDIR = /usr/local/pgsql
6+
67
TARGET = findoidjoins
7-
CFLAGS = -g -Wall -I. -I../pginterface -I../../src/interfaces/libpq -I/usr/local/pgsql/include
8-
LDFLAGS = -L/usr/local/pgsql/lib -lpq
8+
PGEASY = ../../src/interfaces/libpgeasy
9+
CFLAGS = -g -Wall -I. -I$(PGEASY) -I$(INSTALLDIR)/include
10+
LIBPGEASY =$(PGEASY)/libpgeasy.a
11+
LDFLAGS = -L$(INSTALLDIR)/lib -lpq
912

1013
all :$(TARGET)
1114

12-
findoidjoins:$(PGINTERFACE)findoidjoins.c
13-
gcc -o$@$(CFLAGS)$@.c$(PGINTERFACE)$(LDFLAGS)
15+
findoidjoins:findoidjoins.c$(LIBPGEASY)
16+
gcc -o$@$(CFLAGS)$^$(LDFLAGS)
1417

1518
clean:
1619
rm -f*.o$(TARGET) log core
1720

1821
install:
19-
install -s -o bin -g bin$(TARGET)/usr/local/pgsql/bin
22+
install -s -o bin -g bin$(TARGET)$(INSTALLDIR)/bin
2023

‎contrib/findoidjoins/README

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
This program scans a database, and prints oid fields (also regproc fields)
55
and the tables they join to. CAUTION: it is ver-r-r-y slow on a large
66
database, or even a not-so-large one. We don't really recommend running
7-
it on anything but an empty database.
7+
it on anything but an empty database, such as template1.
88

99
Uses pgeasy library.
1010

1111
Run on an empty database, it returns the system join relationships (shown
12-
below for6.5). Note that unexpected matches may indicate bogus entries
12+
below for7.0). Note that unexpected matches may indicate bogus entries
1313
in system tables --- don't accept a peculiar match without question.
1414
In particular, a field shown as joining to more than one target table is
15-
probably messed up. In6.5, the *only* field that should join to more
15+
probably messed up. In7.0, the *only* field that should join to more
1616
than one target is pg_description.objoid. (Running make_oidjoins_check
1717
is an easy way to spot fields joining to more than one table, BTW.)
1818

@@ -45,11 +45,10 @@ Join pg_am.amendscan => pg_proc.oid
4545
Join pg_am.ammarkpos => pg_proc.oid
4646
Join pg_am.amrestrpos => pg_proc.oid
4747
Join pg_am.ambuild => pg_proc.oid
48+
Join pg_am.amcostestimate => pg_proc.oid
4849
Join pg_amop.amopid => pg_am.oid
4950
Join pg_amop.amopclaid => pg_opclass.oid
5051
Join pg_amop.amopopr => pg_operator.oid
51-
Join pg_amop.amopselect => pg_proc.oid
52-
Join pg_amop.amopnpages => pg_proc.oid
5352
Join pg_amproc.amid => pg_am.oid
5453
Join pg_amproc.amopclaid => pg_opclass.oid
5554
Join pg_amproc.amproc => pg_proc.oid
@@ -75,6 +74,10 @@ Join pg_operator.oprjoin => pg_proc.oid
7574
Join pg_proc.prolang => pg_language.oid
7675
Join pg_proc.prorettype => pg_type.oid
7776
Join pg_rewrite.ev_class => pg_class.oid
77+
Join pg_statistic.starelid => pg_class.oid
78+
Join pg_statistic.staop => pg_operator.oid
79+
Join pg_trigger.tgrelid => pg_class.oid
80+
Join pg_trigger.tgfoid => pg_proc.oid
7881
Join pg_type.typrelid => pg_class.oid
7982
Join pg_type.typelem => pg_type.oid
8083
Join pg_type.typinput => pg_proc.oid

‎contrib/findoidjoins/findoidjoins.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
/*
2-
* findoidjoins.c,required pgsql/contrib/pginterface
2+
* findoidjoins.c,requires src/interfaces/libpgeasy
33
*
44
*/
55

66
#include<stdio.h>
77
#include<string.h>
8+
#include"libpq-fe.h"
9+
810
#include"halt.h"
9-
#include<libpq-fe.h>
10-
#include"pginterface.h"
11+
#include"libpgeasy.h"
1112

1213
PGresult*attres,
1314
*relres;
@@ -69,14 +70,14 @@ main(int argc, char **argv)
6970
sprintf(query,"\
7071
DECLARE c_matches BINARY CURSOR FOR \
7172
SELECTcount(*) \
72-
FROM %s t1, %s t2 \
73-
WHERE t1.%s = t2.oid ",relname,relname2,attname);
73+
FROM %s t1, %s t2 \
74+
WHERE t1.%s = t2.oid ",relname,relname2,attname);
7475
else
7576
sprintf(query,"\
7677
DECLARE c_matches BINARY CURSOR FOR \
7778
SELECTcount(*) \
78-
FROM %s t1, %s t2 \
79-
WHERE RegprocToOid(t1.%s) = t2.oid ",relname,relname2,attname);
79+
FROM %s t1, %s t2 \
80+
WHERE RegprocToOid(t1.%s) = t2.oid ",relname,relname2,attname);
8081

8182
doquery(query);
8283
doquery("FETCH ALL IN c_matches");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp