Skip to content

Commit f40117a

Browse files
committed
Merge branch 'master' of github.com:musically-ut/stackexchange-dump-to-postgres
2 parents abafc24 + 96e8a16 commit f40117a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Schema hints are taken from [a post on Meta.StackExchange](http://meta.stackexch
3535
## Caveats and TODOs
3636

3737
- It prepares some indexes and views which may not be necessary for your analysis.
38-
- The `Body` field in `Posts` table is NOT populated.
38+
- The `Body` field in `Posts` table is NOT populated by default. You have to use `--with-post-body` argument to include it.
3939
- The `EmailHash` field in `Users` table is NOT populated.
4040
- Some tables (e.g. `PostHistory` and `Comments`) are missing.
4141

load_into_pg.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ def handleTable(table, keys, dbname, mbDbFile, mbHost, mbPort, mbUsername, mbPas
152152
, default = None
153153
)
154154

155+
parser.add_argument( '--with-post-body'
156+
, help = 'Import the posts with the post body. Only used if importing Posts.xml'
157+
, action = 'store_true'
158+
, default = False
159+
)
160+
155161
args = parser.parse_args()
156162

157163
table = args.table
@@ -213,6 +219,10 @@ def handleTable(table, keys, dbname, mbDbFile, mbHost, mbPort, mbUsername, mbPas
213219
, 'ClosedDate'
214220
, 'CommunityOwnedDate'
215221
]
222+
223+
if args.with_post_body:
224+
keys.append('Body')
225+
216226
elif table == 'Tags':
217227
keys = [
218228
'Id'

0 commit comments

Comments
 (0)