title: Concatenate 'table name + id', then use that variable to drop and create a new table name in Postgresql
body: <p>I'm in the process of creating partitioned tables, so I need to create one table per cost center using an input table that may have one or more rows of cost center data.  The input table has a column named <code>'cost_center'</code>.  I'm using Postgresql 9.5.  </p>
  
  <p>To concatenate the table name, I wrote the following:</p>
  
  <pre><code>select cost_cent, 
  concat('a_save_tbl_', cost_center) hold_tbl_name from a_input_tbl 
  limit 1;
  </code></pre>
  
  <p>This command returns <code>'a_save_tbl_AA'</code> which is the right table name.  Then I tried variations of:</p>
  
  <pre><code>query1 := format('drop if exists %I, hold_tbl_name);
  </code></pre>
  
  <p>No success.  I can't find the right code to drop, create and populate the new tables.  I read a lot of posting and documentation but, everything returns syntax errors.  I would appreciate some help.</p>