我的[error: relation "causes" does not exist]
节点应用程序出现错误。这种关系确实存在,我不确定问题是什么。
我用
CREATE TABLE causes (
cause_id bigint NOT NULL default nextval('causes_cause_id_seq'::regclass),
cause_name varchar(40) NOT NULL,
goal integer,
sponsor varchar(30),
organization varchar(30),
submitter varchar(30),
address varchar(34),
balance numeric
);
这是给出错误的查询:
client = pg.connect(connectionString, function(err, client, done){
if(err) console.log(err);
client.query('INSERT INTO causes (cause_name, goal, organization, sponsor, submitter) VALUES ($1,$2,$3,$4,$5) RETURNING *', r, function(err, result){
if(err) console.log(err);
});
});