Skip to content

Commit f534a9f

Browse files
committed
- Refactored an oid2name script and renamed (generated) data files.
1 parent 48fb416 commit f534a9f

File tree

8 files changed

+37
-227
lines changed

8 files changed

+37
-227
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ include $(top_builddir)/src/Makefile.global
2121
include $(top_srcdir)/contrib/contrib-global.mk
2222
endif
2323

24-
majorversion=`echo $(VERSION) | sed -e 's/^\([0-9]*\.[0-9]*\).*/\1/g'`
24+
majorversion=`echo $(VERSION) | sed -e 's/^\([0-9]*\)\.\([0-9]*\).*/\1\2/g'`
2525

2626
xlogdump_oid2name.o: oid2name.txt
2727

2828
oid2name.txt:
29-
cp oid2name-$(majorversion).*.txt oid2name.txt
29+
cp oid2name-$(majorversion).txt oid2name.txt

gen_oid2name.sh

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
11
#!/bin/sh
22

3-
PSQL_OPTS='-p 5432'
3+
VERSIONS="92 91 90 84 83"
44

5-
psql -A -t -F' ' $PSQL_OPTS postgres -c 'SELECT oid,spcname FROM pg_tablespace ORDER BY oid'
6-
psql -A -t -F' ' $PSQL_OPTS postgres -c 'SELECT oid,datname FROM pg_database ORDER BY oid'
7-
psql -A -t -F' ' $PSQL_OPTS postgres -c 'SELECT oid,relname FROM pg_class ORDER BY oid'
5+
PORT_OPTS='-p 5434'
86

7+
for v in $VERSIONS
8+
do if [ -d /usr/local/pgsql${v} ]; then
9+
export PGDATA=/tmp/pgdata${v}
10+
export PATH=/usr/local/pgsql${v}/bin:$PATH
11+
12+
rm -rf $PGDATA
13+
mkdir $PGDATA
14+
initdb --no-locale -D ${PGDATA}
15+
16+
pg_ctl -w -D ${PGDATA} start -o "$PORT_OPTS"
17+
18+
cat /dev/null > oid2name-${v}.txt
19+
psql -A -t -F' ' $PORT_OPTS postgres -c 'SELECT oid,spcname FROM pg_tablespace ORDER BY oid' >> oid2name-${v}.txt
20+
psql -A -t -F' ' $PORT_OPTS postgres -c 'SELECT oid,datname FROM pg_database ORDER BY oid' >> oid2name-${v}.txt
21+
psql -A -t -F' ' $PORT_OPTS postgres -c 'SELECT oid,relname FROM pg_class ORDER BY oid' >> oid2name-${v}.txt
22+
23+
pg_ctl -w -D ${PGDATA} stop
24+
25+
rm -rf ${PGDATA}
26+
fi;
27+
done;

oid2name-8.2.21.txt

Lines changed: 0 additions & 209 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

oid2name-9.0.4.txt renamed to oid2name-90.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
1663 pg_default
22
1664 pg_global
33
1 template1
4-
11866 template0
5-
11874 postgres
4+
11818 template0
5+
11826 postgres
66
112 pg_foreign_data_wrapper_oid_index
77
113 pg_foreign_server_oid_index
88
174 pg_user_mapping_oid_index

oid2name-9.1.0.txt renamed to oid2name-91.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
1663 pg_default
22
1664 pg_global
33
1 template1
4-
12690 template0
5-
12698 postgres
4+
12691 template0
5+
12699 postgres
66
112 pg_foreign_data_wrapper_oid_index
77
113 pg_foreign_server_oid_index
88
174 pg_user_mapping_oid_index
@@ -276,11 +276,11 @@
276276
12389 foreign_data_wrapper_options
277277
12392 foreign_data_wrappers
278278
12395 _pg_foreign_servers
279-
12398 foreign_server_options
280-
12401 foreign_servers
281-
12404 _pg_foreign_tables
282-
12408 foreign_table_options
283-
12411 foreign_tables
284-
12414 _pg_user_mappings
285-
12417 user_mapping_options
286-
12421 user_mappings
279+
12399 foreign_server_options
280+
12402 foreign_servers
281+
12405 _pg_foreign_tables
282+
12409 foreign_table_options
283+
12412 foreign_tables
284+
12415 _pg_user_mappings
285+
12418 user_mapping_options
286+
12422 user_mappings
File renamed without changes.

0 commit comments

Comments
 (0)