1.
-- mysql select column_name from information_schema.columns where table_schema='SH_ERP' and TABLE_NAME = 'stock_quant' select * from information_schema.columns where table_schema='SH_ERP' and TABLE_NAME = 'stock_quant'; -- pg SELECT array_to_string(array_agg(a.attname),',') FROM pg_class as c,pg_attribute as a where c.relname = 'stock_quant' and a.attrelid = c.oid and a.attnum>0