以后更改字段长度会重写表,如果表比较大,那么表会加锁,需要很长时间 通过一种方法通过修改pg_attribute.atttypmod字段修改长度,不需要重写表 查询select * from pg_attribute where attrelid='sp_sa_salestat'::regclass and attname='goodsname'将字段opcode修改为100长度单位 update pg_attribute set atttypmod=206 where attrelid='sp
一.引入 最近遇到一个项目里面的功能,在给实体类赋值的时候,由于赋值字段是动态生成的,所以如果用常用的方法(直接实体类的名称.字段名=要赋的值),将会生成很多无用的代码,所以找到了一个通过反射的赋值与取值的方法,顺便总结一下,以及对比一下与Python语言同样实现该功能的区别之处. 二.C# 1.赋值 2.取值 3.源码 using System; using System.Collections.Generic; using System.Linq; using System.Reflecti