insert - IF EXIST before many insertions in PostgreSQL? -


i insert if table exists. pseudocode

if exists table file_headers( insert file_headers (measurement_id, file_header_index_start, file_header_index_end) values (1, 1, 100); insert file_headers (measurement_id, file_header_index_start, file_header_index_end) values (1, 2, 100); ... -- many inserts same table ); 

how can insert if table exists in postgresql?

this test make sense if wanted pass table names function dynamic execution.

there built-in solution that: if want make sure table exists, cast regclass (or use regclass parameter function begin with). verifies existence , escapes possible non-standard syntax @ same time:


Comments