title: Insert data in Table using a pre-specified json Postgresql
body: <p>I have a geojson pre-specified as data in PostgreSQL pgAdmin4 query tool.I am trying to insert data into table but as my JSON is large so instead of manually doing Insert into I do this:</p>
  
  <pre><code>WITH data AS (SELECT '{ "type": "FeatureCollection",
  "features": [
    { "type": "Feature",
      "geometry": {"type": "Point", "coordinates": [102.0, 0.5]},
      "properties": {"prop0": "value0"}
      },
    { "type": "Feature",
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]
          ]
        },
      "properties": {
        "prop0": "value0",
        "prop1": 0.0
        }
      }
     ]
   }'::json AS fc)
  </code></pre>
  
  <p>Now trying to insert this data into table like this:</p>
  
  <pre><code>INSERT INTO locations (gid, geom, properties) VALUES ( data );
  </code></pre>
  
  <p>It gives me an error that <code>column data doesn't exist</code>.But when I do this:</p>
  
  <pre><code>SELECT
  row_number() OVER () AS gid,
  ST_AsText(ST_GeomFromGeoJSON(feat-&gt;&gt;'geometry')) AS geom,
  feat-&gt;'properties' AS properties
  FROM (
   SELECT json_array_elements(fc-&gt;'features') AS feat
  FROM data
   ) AS f;
  </code></pre>
  
  <p>This query shows data. My issue is that when I want I can select and see data but as this is not stores anywhere so everytime I need to do <code>WITH data as</code> declare json and apply the select query. So I want to inset value in to my table so I can call this anytime. </p>