-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcsv2psql-2011.map
134 lines (106 loc) · 5.66 KB
/
csv2psql-2011.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
127
128
129
130
131
132
133
134
# 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 2011 STE_2011_AUST.STATE_CODE_2011 ste.code
1 2011 STE_2011_AUST.STATE_NAME_2011 ste.name
2 2011 IREG_2011_AUST.IREG_CODE_2011 ireg.code
2 2011 IREG_2011_AUST.IREG_NAME_2011 ireg.name
2 2011 IREG_2011_AUST.STATE_CODE_2011 ireg.ste
2 2011 IARE_2011_AUST.IARE_CODE_2011 iare.code
2 2011 IARE_2011_AUST.IARE_NAME_2011 iare.name
2 2011 IARE_2011_AUST.IREG_CODE_2011 iare.ireg
2 2011 IARE_2011_AUST.STATE_CODE_2011 iare.ste
2 2011 ILOC_2011_AUST.ILOC_CODE_2011 iloc.code
2 2011 ILOC_2011_AUST.ILOC_NAME_2011 iloc.name
2 2011 ILOC_2011_AUST.IARE_CODE_2011 iloc.iare
2 2011 ILOC_2011_AUST.IREG_CODE_2011 iloc.ireg
2 2011 ILOC_2011_AUST.STATE_CODE_2011 iloc.ste
# Indigenous_Structure_Allocation_2011 adds the I* refs to SA1s
1 2011 GCCSA_2011_AUST.GCCSA_CODE_2011 gccsa.code
1 2011 GCCSA_2011_AUST.GCCSA_NAME_2011 gccsa.name
1 2011 GCCSA_2011_AUST.STATE_CODE_2011 gccsa.ste
1 2011 SA4_2011_AUST.SA4_CODE_2011 sa4.code
1 2011 SA4_2011_AUST.SA4_NAME_2011 sa4.name
1 2011 SA4_2011_AUST.GCCSA_CODE_2011 sa4.gccsa
1 2011 SA4_2011_AUST.STATE_CODE_2011 sa4.ste
1 2011 SA3_2011_AUST.SA3_CODE_2011 sa3.code
1 2011 SA3_2011_AUST.SA3_NAME_2011 sa3.name
1 2011 SA3_2011_AUST.SA4_CODE_2011 sa3.sa4
1 2011 SA3_2011_AUST.GCCSA_CODE_2011 sa3.gccsa
1 2011 SA3_2011_AUST.STATE_CODE_2011 sa3.ste
3 2011 TR_2011_AUST.TR_Code_2011 tr.code
3 2011 TR_2011_AUST.TR_Name_2011 tr.name
1 2011 SA2_2011_AUST.SA2_MAINCODE_2011 sa2.code
1 2011 SA2_2011_AUST.SA2_NAME_2011 sa2.name
1 2011 SA2_2011_AUST.SA3_CODE_2011 sa2.sa3
1 2011 SA2_2011_AUST.SA4_CODE_2011 sa2.sa4
1 2011 SA2_2011_AUST.GCCSA_CODE_2011 sa2.gccsa
1 2011 SA2_2011_AUST.STATE_CODE_2011 sa2.ste
3 2011 ADD_2011_AUST.ADD_CODE_2011 add.code
3 2011 ADD_2011_AUST.ADD_NAME_2011 add.name
3 2011 CED_2011_AUST.CED_CODE_2011 ced.code
3 2011 CED_2011_AUST.CED_NAME_2011 ced.name
3 2011 SED_2011_AUST.SED_CODE_2011 sed.code
3 2011 SED_2011_AUST.SED_NAME_2011 sed.name
3 2011 NRMR_2011_AUST.NRMR_CODE_2011 nrmr.code
3 2011 NRMR_2011_AUST.NRMR_NAME_2011 nrmr.name
3 2011 SSC_2011_AUST.SSC_CODE_2011 ssc.code
3 2011 SSC_2011_AUST.SSC_NAME_2011 ssc.name
3 2011 SSC_2011_AUST.CONF_VALUE ssc.confidence
3 2011 POA_2011_AUST.POA_CODE_2011 poa.code
3 2011 POA_2011_AUST.POA_NAME_2011 poa.name
3 2011 LGA_2011_*.LGA_CODE_2011 lga.code
3 2011 LGA_2011_*.LGA_NAME_2011 lga.name
3 2011 LGA_2011_*.STATE_CODE_2011 lga.ste
4 2011 SUA_2011_AUST.SUA_CODE_2011 sua.code
4 2011 SUA_2011_AUST.SUA_NAME_2011 sua.name
4 2011 UCL_2011_AUST.UCL_CODE_2011 ucl.code
4 2011 UCL_2011_AUST.UCL_NAME_2011 ucl.name
4 2011 SA1_UCL_SOSR_SOS_2011_AUST.SOSR_CODE_2011 sosr.code
4 2011 SA1_UCL_SOSR_SOS_2011_AUST.SOSR_NAME_2011 sosr.name
4 2011 SA1_UCL_SOSR_SOS_2011_AUST.SOS_CODE_2011 sos.code
4 2011 SA1_UCL_SOSR_SOS_2011_AUST.SOS_NAME_2011 sos.name
5 2011 RA_2011_*.RA_CODE_2011 ra.code
5 2011 RA_2011_*.RA_NAME_2011 ra.name
5 2011 RA_2011_*.STATE_CODE_2011 ra.ste
1 2011 SA1_2011_AUST.SA1_MAINCODE_2011 sa1.code
1 2011 SA1_2011_AUST.SA2_MAINCODE_2011 sa1.sa2
1 2011 SA1_2011_AUST.SA3_CODE_2011 sa1.sa3
1 2011 SA1_2011_AUST.SA4_CODE_2011 sa1.sa4
1 2011 SA1_2011_AUST.GCCSA_CODE_2011 sa1.gccsa
1 2011 SA1_2011_AUST.STATE_CODE_2011 sa1.ste
1 2011 MB_2011_*.MB_CODE_2011 mb.code
1 2011 MB_2011_*.MB_CATEGORY_2011 mb.category
1 2011 MB_2011_*.SA1_MAINCODE_2011 mb.sa1
1 2011 MB_2011_*.SA2_MAINCODE_2011 mb.sa2
1 2011 MB_2011_*.SA3_CODE_2011 mb.sa3
1 2011 MB_2011_*.SA4_CODE_2011 mb.sa4
1 2011 MB_2011_*.GCCSA_CODE_2011 mb.gccsa
1 2011 MB_2011_*.STATE_CODE_2011 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.
LINK 2 2011 Indigenous_Structure_Allocation_2011.SA1_MAINCODE_2011 sa1.code Indigenous_Structure_Allocation_2011.ILOC_CODE_2011 sa1.iloc
LINK 3 2011 POA_2011_AUST.SA1_MAINCODE_2011 sa1.code POA_2011_AUST.POA_CODE_2011 sa1.poa
LINK 3 2011 SSC_2011_AUST.SA1_MAINCODE_2011 sa1.code SSC_2011_AUST.SSC_CODE_2011 sa1.ssc
LINK 3 2011 CED_2011_AUST.SA1_MAINCODE_2011 sa1.code CED_2011_AUST.CED_CODE_2011 sa1.ced
LINK 3 2011 SED_2011_AUST.SA1_MAINCODE_2011 sa1.code SED_2011_AUST.SED_CODE_2011 sa1.sed
LINK 3 2011 ADD_2011_AUST.SA1_MAINCODE_2011 sa1.code ADD_2011_AUST.ADD_CODE_2011 sa1.add
LINK 3 2011 NRMR_2011_AUST.SA1_MAINCODE_2011 sa1.code NRMR_2011_AUST.NRMR_CODE_2011 sa1.nrmr
# FIXME how to update these for 2015?
LINK 3 2011 TR_2011_AUST.SA2_MAINCODE_2011 sa2.code TR_2011_AUST.TR_Code_2011 sa2.tr
LINK 3 2011 LGA_2011_*.MB_CODE_2011 mb.code LGA_2011_*.LGA_CODE_2011 mb.lga
LINK 4 2011 SA2_SUA_2011_AUST.SA2_MAINCODE_2011 sa2.code SA2_SUA_2011_AUST.SUA_CODE_2011 sa2.sua
LINK 4 2011 SA1_UCL_SOSR_SOS_2011_AUST.SA1_MAINCODE_2011 sa1.code SA1_UCL_SOSR_SOS_2011_AUST.UCL_CODE_2011 sa1.ucl
LINK 4 2011 SA1_UCL_SOSR_SOS_2011_AUST.UCL_CODE_2011 ucl.code SA1_UCL_SOSR_SOS_2011_AUST.SOSR_CODE_2011 ucl.sosr
LINK 4 2011 SA1_UCL_SOSR_SOS_2011_AUST.SOSR_CODE_2011 sosr.code SA1_UCL_SOSR_SOS_2011_AUST.SOS_CODE_2011 sosr.sos
LINK 5 2011 SA1_2011_RA_2011_AUST.SA1_MAINCODE_2011 SA1_2011_RA_2011_AUST.RA_CODE_2011 sa1.ra