I have a change set with the following entries (simplified as there are more columns in practice):
<createTable tableType="temporary" tableName="tag184_csv_table">
<column name="postal_code" type="text"/>
</createTable>
<loadData
commentLineStartsWith="//"
encoding="UTF-8"
file="pathTo.csv"
quotchar="""
relativeToChangelogFile="true"
separator=","
tableName="tag184_csv_table"
usePreparedStatements="true">
<column name="postal_code" type="string"/>
</loadData>
The temporary table creation works fine, thus:
CREATE TEMPORARY TABLE tag184_csv_table (postal_code TEXT)
However the CSV insert fails as the generated SQL is:
INSERT INTO public.tag184_csv_table(postal_code) VALUES(?)
Which results in:
ERROR: relation "public.tag184_csv_table" does not exist
In Postgres, temporary tables exist in a hidden, unique, and session-specific high-priority schema, and no schema should be specified when referencing them in any SQL statement.
So, is there a way to suppress the inclusion of the (default) schema name for the insertion? I am aware there is a schemaName="something"
attribute supported by <loadData
, but that is the opposite of what is wanted here (and it treats a blank string value as missing and inserts public.
).
Thanks!