PostgreSQL有外部表的概念,可以使用CSV文件作为表源.在MySQL中有办法做到这一点吗?在我的例子中,我不想导入文件,因为它每分钟都会更改(通过crontabb重写).
CREATE FOREIGN TABLE IF NOT EXISTS rawdata.system_ps (
pid text,
started text,
cpu_pcnt text,
mem_pcnt text,
command text
)
SERVER "import" options (
FILENAME '/var/tmp/system_ps.csv',
FORMAT 'csv',
HEADER 'true'
);