The invention relates to a method for simplifying PostgreSQL division codes. The method resolves the problems that as each main table needs to correspond to at least one trigger function, more main tables are, more trigger functions need writing, the maintenance workloads of the codes are larger and the error probability is higher. According to the technical scheme, the method includes the following steps of firstly, building the main tables, secondly, building secondary tables, thirdly, building trigger functions, and fourthly, building a before trigger, transmitting four character string parameters, and simplifying the PostgreSQL division codes. In the fourth step of the building the before trigger, the transmitted four character string parameters are schemaname, tablename, partition name and partition method respectively. In the first step, the trigger functions receive the four character string parameters of schemaname, tablename, partition name and partition method.