如何使用python将json数据存储到Postgresql数据库中

时间:2018-12-23 13:07:09

标签: python-2.7 postgresql-9.5

我有一个如下的JSON文件

   [{

            "name": "java",
            "created": "12-2-2016",
            "status": "null",
            "Qota": 1024,
            "Memory": 256,
            "duaration": 100,
            "place": "japan",
            "type": "c.large"
        }
    ,
    {

            "name": "python",
            "created": "12-12-2012",
            "status": "null",

            "Qota": 512,
            "Memory": 256,
            "duaration": 100,
            "place": "Canada",
            "type": "x.large"

    },
    {

            "name": "c",
            "created": "2-2-2010",
            "status": "null",


            "Qota": 1024,
            "Memory": 256,
            "duaration": 100,
            "place": "Us",
            "type": "d.large"

    }]

我需要将此json数据插入POSTGRESQL DATABASE。我只需要元数据中的几个字段和实体中的两个字段;

我的表格如下所示:

==========================

    Name          Created      Qota    type
    java          12-2-2016     1024    c.large
    python        12-12-2016    512     x.large
    c             2-2-2016      1024    d.large 

0 个答案:

没有答案