From: David E. W. <da...@ju...> - 2014-02-05 17:04:00
|
On Feb 4, 2014, at 10:18 PM, Abbas Butt <abb...@en...> wrote: > I had to change the insert query a little bit and had to do some dummy inserts in projects and changes too, but the query worked fine for me. BTW I tried on current master, I am not sure which version you are using to test. The 1.1 release. > Here are the queries I tried. > > After creating the three tables, I did > > insert into projects values('?', '?', DEFAULT, '?', '?'); > > insert into changes values('?', '?', '?', '?', DEFAULT, '?', '?', clock_timestamp(), '?', '?'); > > INSERT INTO tags (tag_id, tag, project, change_id, note, committer_name, committer_email, planned_at, planner_name, planner_email) > SELECT tid, tg, proj, chid, n, name, email, at, pname, pemail FROM ( VALUES ('?', '?', '?', '?', '?', '?', '?', clock_timestamp()::timestamptz, '?', '?')) i(tid, tg, proj, chid, n, name, email, at, pname, pemail) LEFT JOIN tags ON i.tid = tags.tag_id WHERE tags.tag_id IS NULL; On 1.1: dwheeler=# insert into sqitch.projects values('?', '?', DEFAULT, '?', '?'); INSERT 0 1 Time: 48.720 ms dwheeler=# insert into sqitch.changes values('?', '?', '?', '?', DEFAULT, '?', '?', clock_timestamp(), '?', '?'); INSERT 0 1 Time: 43.704 ms dwheeler=# INSERT INTO sqitch.tags (tag_id, tag, project, change_id, note, committer_name, committer_email, planned_at, planner_name, planner_email) dwheeler=# INSERT INTO sqitch.tags (tag_id, tag, project, change_id, note, committer_name, committer_email, planned_at, planner_name, planner_email) dwheeler-# SELECT tid, tg, proj, chid, n, name, email, at, pname, pemail FROM ( VALUES ('?', '?', '?', '?', '?', '?', '?', clock_timestamp()::timestamptz, '?', '?')) i(tid, tg, proj, chid, n, name, email, at, pname, pemail) LEFT JOIN sqitch.tags ON i.tid = tags.tag_id WHERE tags.tag_id IS NULL; ERROR: unexpected varno 6 in JOIN RTE 5 Time: 4.064 ms Best, David |