[x] Function createOpenCloseStaging is unnecessary (E): Move the CREATE TABLE statement in that function to a separate file createOpenCloseStagingTable.sql
[x] Rename the file to importOpenClose.sql
[x] Use CREATE TEMPORARY TABLE instead of using pg_temp schema (use of pg_temp schema is required to use temp functions because there is no CREATE TEMPORARY FUNCTION)
[x] Rename function openCloseImport to importOpenClose
importOpenCloseCSV.bat:
[x] The prologue comment is incomplete
[x] Replace call to function createOpenCloseStaging() based on aforementioned revisions to openCloseImport.sql
[x] Force execution of all commands in a single transaction: see importRosterCSV.bat
[x] Use or enforce the effect psql command ON_ERROR_STOP
Caveat: I assume COPY FROM would not have any trouble working with an unqualified temp table.
openCloseImport.sql
:createOpenCloseStaging
is unnecessary (E): Move theCREATE TABLE
statement in that function to a separate filecreateOpenCloseStagingTable.sql
importOpenClose.sql
CREATE TEMPORARY TABLE
instead of usingpg_temp
schema (use ofpg_temp
schema is required to use temp functions because there is noCREATE TEMPORARY FUNCTION
)openCloseImport
toimportOpenClose
importOpenCloseCSV.bat
:createOpenCloseStaging()
based on aforementioned revisions toopenCloseImport.sql
importRosterCSV.bat
ON_ERROR_STOP
Caveat: I assume
COPY FROM
would not have any trouble working with an unqualified temp table.