-
Notifications
You must be signed in to change notification settings - Fork 1
/
csv2psql-2016.map
126 lines (98 loc) · 4.99 KB
/
csv2psql-2016.map
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# This file defines the attribute mapping used to load the ABS ASGS CSV files
# into our database (which has the schema defined in 03-create-asgs-schema.sql).
#
# Lines must be of the format (unless they begin with LINK which we explain
# later on in this file):
# ABS_VOL_NUM SCHEMA CSV_FILE.CSV_FILE_ATTRIBUTE PSQL_TABLE.PSQL_ATTRIBUTE
# To the extent possible under law, the person who associated CC0
# with this work has waived all copyright and related or neighboring
# rights to this work.
# http://creativecommons.org/publicdomain/zero/1.0/
# This schema is partly derived from the ASGS structure.
# http://www.abs.gov.au/websitedbs/D3310114.nsf/home/Australian+Statistical+Geography+Standard+%28ASGS%29
1 2016 STE_2016_AUST.STATE_CODE_2016 ste.code
1 2016 STE_2016_AUST.STATE_NAME_2016 ste.name
2 2016 IREG_2016_AUST.IREG_CODE_2016 ireg.code
2 2016 IREG_2016_AUST.IREG_NAME_2016 ireg.name
2 2016 IREG_2016_AUST.STATE_CODE_2016 ireg.ste
2 2016 IARE_2016_AUST.IARE_CODE_2016 iare.code
2 2016 IARE_2016_AUST.IARE_NAME_2016 iare.name
2 2016 IARE_2016_AUST.IREG_CODE_2016 iare.ireg
2 2016 IARE_2016_AUST.STATE_CODE_2016 iare.ste
2 2016 ILOC_2016_AUST.ILOC_CODE_2016 iloc.code
2 2016 ILOC_2016_AUST.ILOC_NAME_2016 iloc.name
2 2016 ILOC_2016_AUST.IARE_CODE_2016 iloc.iare
2 2016 ILOC_2016_AUST.IREG_CODE_2016 iloc.ireg
2 2016 ILOC_2016_AUST.STATE_CODE_2016 iloc.ste
# Indigenous_Structure_Allocation_2016 adds the I* refs to SA1s
1 2016 GCCSA_2016_AUST.GCCSA_CODE_2016 gccsa.code
1 2016 GCCSA_2016_AUST.GCCSA_NAME_2016 gccsa.name
1 2016 GCCSA_2016_AUST.STATE_CODE_2016 gccsa.ste
1 2016 SA4_2016_AUST.SA4_CODE_2016 sa4.code
1 2016 SA4_2016_AUST.SA4_NAME_2016 sa4.name
1 2016 SA4_2016_AUST.GCCSA_CODE_2016 sa4.gccsa
1 2016 SA4_2016_AUST.STATE_CODE_2016 sa4.ste
1 2016 SA3_2016_AUST.SA3_CODE_2016 sa3.code
1 2016 SA3_2016_AUST.SA3_NAME_2016 sa3.name
1 2016 SA3_2016_AUST.SA4_CODE_2016 sa3.sa4
1 2016 SA3_2016_AUST.GCCSA_CODE_2016 sa3.gccsa
1 2016 SA3_2016_AUST.STATE_CODE_2016 sa3.ste
3 2016 TR_2016_AUST.TR_CODE_2016 tr.code
3 2016 TR_2016_AUST.TR_NAME_2016 tr.name
1 2016 SA2_2016_AUST.SA2_MAINCODE_2016 sa2.code
1 2016 SA2_2016_AUST.SA2_NAME_2016 sa2.name
1 2016 SA2_2016_AUST.SA3_CODE_2016 sa2.sa3
1 2016 SA2_2016_AUST.SA4_CODE_2016 sa2.sa4
1 2016 SA2_2016_AUST.GCCSA_CODE_2016 sa2.gccsa
1 2016 SA2_2016_AUST.STATE_CODE_2016 sa2.ste
3 2016 ADD_2016_AUST.ADD_CODE_2016 add.code
3 2016 ADD_2016_AUST.ADD_NAME_2016 add.name
3 2016 CED_2016_AUST.CED_CODE_2016 ced.code
3 2016 CED_2016_AUST.CED_NAME_2016 ced.name
3 2016 SED_2016_AUST.SED_CODE_2016 sed.code
3 2016 SED_2016_AUST.SED_NAME_2016 sed.name
3 2016 NRMR_2016_AUST.NRMR_CODE_2016 nrmr.code
3 2016 NRMR_2016_AUST.NRMR_NAME_2016 nrmr.name
3 2016 SSC_2016_AUST.SSC_CODE_2016 ssc.code
3 2016 SSC_2016_AUST.SSC_NAME_2016 ssc.name
3 2016 POA_2016_AUST.POA_CODE_2016 poa.code
3 2016 POA_2016_AUST.POA_NAME_2016 poa.name
3 2016 LGA_2016_*.LGA_CODE_2016 lga.code
3 2016 LGA_2016_*.LGA_NAME_2016 lga.name
3 2016 LGA_2016_*.STATE_CODE_2016 lga.ste
#4 2016 SUA_2016_AUST.SUA_CODE_2016 sua.code
#4 2016 SUA_2016_AUST.SUA_NAME_2016 sua.name
#4 2016 UCL_2016_AUST.UCL_CODE_2016 ucl.code
#4 2016 UCL_2016_AUST.UCL_NAME_2016 ucl.name
#4 2016 SA1_UCL_SOSR_SOS_2016_AUST.SOSR_CODE_2016 sosr.code
#4 2016 SA1_UCL_SOSR_SOS_2016_AUST.SOSR_NAME_2016 sosr.name
#4 2016 SA1_UCL_SOSR_SOS_2016_AUST.SOS_CODE_2016 sos.code
#4 2016 SA1_UCL_SOSR_SOS_2016_AUST.SOS_NAME_2016 sos.name
#5 2016 RA_2016_*.RA_CODE_2016 ra.code
#5 2016 RA_2016_*.RA_NAME_2016 ra.name
#5 2016 RA_2016_*.STATE_CODE_2016 ra.ste
1 2016 SA1_2016_AUST.SA1_MAINCODE_2016 sa1.code
1 2016 SA1_2016_AUST.SA2_MAINCODE_2016 sa1.sa2
1 2016 SA1_2016_AUST.SA3_CODE_2016 sa1.sa3
1 2016 SA1_2016_AUST.SA4_CODE_2016 sa1.sa4
1 2016 SA1_2016_AUST.GCCSA_CODE_2016 sa1.gccsa
1 2016 SA1_2016_AUST.STATE_CODE_2016 sa1.ste
1 2016 MB_2016_*.MB_CODE_2016 mb.code
1 2016 MB_2016_*.MB_CATEGORY_NAME_2016 mb.category
1 2016 MB_2016_*.SA1_MAINCODE_2016 mb.sa1
1 2016 MB_2016_*.SA2_MAINCODE_2016 mb.sa2
1 2016 MB_2016_*.SA3_CODE_2016 mb.sa3
1 2016 MB_2016_*.SA4_CODE_2016 mb.sa4
1 2016 MB_2016_*.GCCSA_CODE_2016 mb.gccsa
1 2016 MB_2016_*.STATE_CODE_2016 mb.ste
# Many of the Volume 3 datasets can be linked to a Volume 1 dataset. We
# have allowed for this in the schema and the following lines will add
# the foreign keys to the volume 1 dataset tables.
# FIXME
#LINK 2 2016 indigenous_structure_allocation_2016.SA1_MAINCODE_2016 sa1.code indigenous_structure_allocation_2016.ILOC_CODE_2016 sa1.iloc
LINK 3 2016 LGA_2016_*.MB_CODE_2016 mb.code LGA_2016_*.LGA_CODE_2016 mb.lga
#LINK 4 2016 SA2_SUA_2016_AUST.SA2_MAINCODE_2016 sa2.code SA2_SUA_2016_AUST.SUA_CODE_2016 sa2.sua
#LINK 4 2016 SA1_UCL_SOSR_SOS_2016_AUST.SA1_MAINCODE_2016 sa1.code SA1_UCL_SOSR_SOS_2016_AUST.UCL_CODE_2016 sa1.ucl
#LINK 4 2016 SA1_UCL_SOSR_SOS_2016_AUST.UCL_CODE_2016 ucl.code SA1_UCL_SOSR_SOS_2016_AUST.SOSR_CODE_2016 ucl.sosr
#LINK 4 2016 SA1_UCL_SOSR_SOS_2016_AUST.SOSR_CODE_2016 sosr.code SA1_UCL_SOSR_SOS_2016_AUST.SOS_CODE_2016 sosr.sos
#LINK 5 2016 SA1_2016_RA_2016_AUST.SA1_MAINCODE_2016 SA1_2016_RA_2016_AUST.RA_CODE_2016 sa1.ra