1
我使用\i /path/to/some/file.sql
向postgres添加了一个文件,但文件中存在拼写错误。从postgresql中删除外部文件
这里是我有这样的文件:
CREATE VIEW holidays AS
SELECT event_id AS holiday_id, title AS name, starts AS date
FROM events
WHERE title LIKE '%Day%' AND venue_id IS NULL;
在原来的版本我有%DAY%
。当再次运行\i /path/to/some/file.sql
,我收到此错误:
ERROR: relation "holidays" already exists
如何撤消这种关系让代码再次运行?
谢谢
我已经更新了我的问题......其实,我从你所说的并且刚刚跑过'DROP VIEW holidays'找出它的结果 –
请参阅http://www.postgresql.org/docs/9.2/static/sql- dropview.html –