Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
78845177
Commit
78845177
authored
Jan 22, 2000
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
findoidjoins was suffering from bit rot (pginterface no
longer in expected location).
parent
fa5400c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
19 deletions
+26
-19
contrib/findoidjoins/Makefile
contrib/findoidjoins/Makefile
+10
-7
contrib/findoidjoins/README
contrib/findoidjoins/README
+8
-5
contrib/findoidjoins/findoidjoins.c
contrib/findoidjoins/findoidjoins.c
+8
-7
No files found.
contrib/findoidjoins/Makefile
View file @
78845177
#
#
# Makefile, requires
pgsql/contrib/pginterface
# Makefile, requires
src/interfaces/libpgeasy
#
#
#
#
PGINTERFACE
=
../pginterface/pginterface.o ../pginterface/halt.o
# these have to be in your library search path
INSTALLDIR
=
/usr/local/pgsql
TARGET
=
findoidjoins
TARGET
=
findoidjoins
CFLAGS
=
-g
-Wall
-I
.
-I
../pginterface
-I
../../src/interfaces/libpq
-I
/usr/local/pgsql/include
PGEASY
=
../../src/interfaces/libpgeasy
LDFLAGS
=
-L
/usr/local/pgsql/lib
-lpq
CFLAGS
=
-g
-Wall
-I
.
-I
$(PGEASY)
-I
$(INSTALLDIR)
/include
LIBPGEASY
=
$(PGEASY)
/libpgeasy.a
LDFLAGS
=
-L
$(INSTALLDIR)
/lib
-lpq
all
:
$(TARGET)
all
:
$(TARGET)
findoidjoins
:
$(PGINTERFACE) findoidjoins.c
findoidjoins
:
findoidjoins.c $(LIBPGEASY)
gcc
-o
$@
$(CFLAGS)
$
@
.c
$(PGINTERFACE)
$(LDFLAGS)
gcc
-o
$@
$(CFLAGS)
$
^
$(LDFLAGS)
clean
:
clean
:
rm
-f
*
.o
$(TARGET)
log core
rm
-f
*
.o
$(TARGET)
log core
install
:
install
:
install
-s
-o
bin
-g
bin
$(TARGET)
/usr/local/pgsql
/bin
install
-s
-o
bin
-g
bin
$(TARGET)
$(INSTALLDIR)
/bin
contrib/findoidjoins/README
View file @
78845177
...
@@ -4,15 +4,15 @@
...
@@ -4,15 +4,15 @@
This program scans a database, and prints oid fields (also regproc fields)
This program scans a database, and prints oid fields (also regproc fields)
and the tables they join to. CAUTION: it is ver-r-r-y slow on a large
and the tables they join to. CAUTION: it is ver-r-r-y slow on a large
database, or even a not-so-large one. We don't really recommend running
database, or even a not-so-large one. We don't really recommend running
it on anything but an empty database.
it on anything but an empty database
, such as template1
.
Uses pgeasy library.
Uses pgeasy library.
Run on an empty database, it returns the system join relationships (shown
Run on an empty database, it returns the system join relationships (shown
below for
6.5
). Note that unexpected matches may indicate bogus entries
below for
7.0
). Note that unexpected matches may indicate bogus entries
in system tables --- don't accept a peculiar match without question.
in system tables --- don't accept a peculiar match without question.
In particular, a field shown as joining to more than one target table is
In particular, a field shown as joining to more than one target table is
probably messed up. In
6.5
, the *only* field that should join to more
probably messed up. In
7.0
, the *only* field that should join to more
than one target is pg_description.objoid. (Running make_oidjoins_check
than one target is pg_description.objoid. (Running make_oidjoins_check
is an easy way to spot fields joining to more than one table, BTW.)
is an easy way to spot fields joining to more than one table, BTW.)
...
@@ -45,11 +45,10 @@ Join pg_am.amendscan => pg_proc.oid
...
@@ -45,11 +45,10 @@ Join pg_am.amendscan => pg_proc.oid
Join pg_am.ammarkpos => pg_proc.oid
Join pg_am.ammarkpos => pg_proc.oid
Join pg_am.amrestrpos => pg_proc.oid
Join pg_am.amrestrpos => pg_proc.oid
Join pg_am.ambuild => pg_proc.oid
Join pg_am.ambuild => pg_proc.oid
Join pg_am.amcostestimate => pg_proc.oid
Join pg_amop.amopid => pg_am.oid
Join pg_amop.amopid => pg_am.oid
Join pg_amop.amopclaid => pg_opclass.oid
Join pg_amop.amopclaid => pg_opclass.oid
Join pg_amop.amopopr => pg_operator.oid
Join pg_amop.amopopr => pg_operator.oid
Join pg_amop.amopselect => pg_proc.oid
Join pg_amop.amopnpages => pg_proc.oid
Join pg_amproc.amid => pg_am.oid
Join pg_amproc.amid => pg_am.oid
Join pg_amproc.amopclaid => pg_opclass.oid
Join pg_amproc.amopclaid => pg_opclass.oid
Join pg_amproc.amproc => pg_proc.oid
Join pg_amproc.amproc => pg_proc.oid
...
@@ -75,6 +74,10 @@ Join pg_operator.oprjoin => pg_proc.oid
...
@@ -75,6 +74,10 @@ Join pg_operator.oprjoin => pg_proc.oid
Join pg_proc.prolang => pg_language.oid
Join pg_proc.prolang => pg_language.oid
Join pg_proc.prorettype => pg_type.oid
Join pg_proc.prorettype => pg_type.oid
Join pg_rewrite.ev_class => pg_class.oid
Join pg_rewrite.ev_class => pg_class.oid
Join pg_statistic.starelid => pg_class.oid
Join pg_statistic.staop => pg_operator.oid
Join pg_trigger.tgrelid => pg_class.oid
Join pg_trigger.tgfoid => pg_proc.oid
Join pg_type.typrelid => pg_class.oid
Join pg_type.typrelid => pg_class.oid
Join pg_type.typelem => pg_type.oid
Join pg_type.typelem => pg_type.oid
Join pg_type.typinput => pg_proc.oid
Join pg_type.typinput => pg_proc.oid
...
...
contrib/findoidjoins/findoidjoins.c
View file @
78845177
/*
/*
* findoidjoins.c, require
d pgsql/contrib/pginterface
* findoidjoins.c, require
s src/interfaces/libpgeasy
*
*
*/
*/
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include "libpq-fe.h"
#include "halt.h"
#include "halt.h"
#include <libpq-fe.h>
#include "libpgeasy.h"
#include "pginterface.h"
PGresult
*
attres
,
PGresult
*
attres
,
*
relres
;
*
relres
;
...
@@ -69,14 +70,14 @@ main(int argc, char **argv)
...
@@ -69,14 +70,14 @@ main(int argc, char **argv)
sprintf
(
query
,
"\
sprintf
(
query
,
"\
DECLARE c_matches BINARY CURSOR FOR \
DECLARE c_matches BINARY CURSOR FOR \
SELECT count(*) \
SELECT count(*) \
FROM %
s t1, %s t2 \
FROM %s t1, %s t2 \
WHERE t1.%
s = t2.oid "
,
relname
,
relname2
,
attname
);
WHERE t1.%s = t2.oid "
,
relname
,
relname2
,
attname
);
else
else
sprintf
(
query
,
"\
sprintf
(
query
,
"\
DECLARE c_matches BINARY CURSOR FOR \
DECLARE c_matches BINARY CURSOR FOR \
SELECT count(*) \
SELECT count(*) \
FROM %
s t1, %s t2 \
FROM %s t1, %s t2 \
WHERE RegprocToOid(t1.%
s) = t2.oid "
,
relname
,
relname2
,
attname
);
WHERE RegprocToOid(t1.%s) = t2.oid "
,
relname
,
relname2
,
attname
);
doquery
(
query
);
doquery
(
query
);
doquery
(
"FETCH ALL IN c_matches"
);
doquery
(
"FETCH ALL IN c_matches"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment