For example, say I wanted to import a CSV file from a path on the same machine the postgres server is running on.
There is an environmental variable MyPath set on the system to '/path/to/my/csv/file/'.
I could easily import this CSV file as follow:
COPY MyTable FROM
'/path/to/my/csv/file/myTable.csv'
DELIMITERS ','
CSV HEADER;
Is it possible to reference the MyPath variable from within this postgres sql command? Something along the following lines:
COPY MyTable FROM
get_environmental_variable('MyPath') || 'myTable.csv'
DELIMITERS ','
CSV HEADER;