diff --git a/infrastructure/scripts/poi-import.sh b/infrastructure/scripts/poi-import.sh index 1ff9afe..bfcce87 100755 --- a/infrastructure/scripts/poi-import.sh +++ b/infrastructure/scripts/poi-import.sh @@ -105,10 +105,16 @@ gunzip -c "$ARTIFACT" | psql -c \ # One transaction: temp selector table (from map-core) → pois_staging built # LIKE the live table so structure/defaults match the Drizzle schema exactly → # classified insert → indexes. The 70% guard + swap run in step 5. +# +# The selector SQL is streamed from the host into psql's stdin (not `\i`, which +# would look for the file inside the postgres container, where it doesn't +# exist). BEGIN + selectors + the build statements are concatenated into one +# session so the ON COMMIT DROP temp table lives for the whole transaction. log "building classified staging table" -psql <