Re: [HACKERS] 6.5 cvs: views doesn't survives after pg_dump (fwd)
От | Keith Parks |
---|---|
Тема | Re: [HACKERS] 6.5 cvs: views doesn't survives after pg_dump (fwd) |
Дата | |
Msg-id | 199905241321.OAA21686@mtcc.demon.co.uk обсуждение исходный текст |
Ответ на | [HACKERS] 6.5 cvs: views doesn't survives after pg_dump (fwd) (Oleg Bartunov <oleg@sai.msu.su>) |
Ответы |
Re: [HACKERS] 6.5 cvs: views doesn't survives after pg_dump (fwd)
|
Список | pgsql-hackers |
Jan, Have you any ideas on this? We get a rule output by pg_dump like :- CREATE RULE "_RETsongs" AS ON SELECT TO "songs" WHERE DO INSTEAD SELECT "t"."artist", "t"."song", "t"."trackno", "d"."cdname" FROM "disks" "d", "tracks" "t" WHERE "d"."diskid" = "t"."diskid"; from a view defined like so:- CREATE VIEW songs AS SELECT t.artist, t.song, t.trackno, d.cdname FROM disks d, tracks t WHERE d.diskid = t.diskid; Note the WHERE keyword in line 3 of the rule define. >From "./src/backend/utils/adt/ruleutils.c" line 662 of 1814 /* If the rule has an event qualification, add it */ if (ev_qual == NULL) ev_qual = ""; if (strlen(ev_qual) > 0) { Node *qual; Query *query; QryHier qh; . . strcat(buf, " WHERE "); strcat(buf, get_rule_expr(&qh, 0, qual, TRUE)); } strcat(buf, " DO "); /* The INSTEAD keyword (if so) */ if (is_instead) strcat(buf, "INSTEAD "); We put the WHERE in if strlen(ev_qual) > 0 I've not yet followed this back any further. Keith. ------------ Begin Forwarded Message ------------- X-Authentication-Warning: hub.org: majordom set sender to owner-pgsql-hackers@postgreSQL.org using -f Date: Fri, 21 May 1999 22:34:50 +0100 (BST) From: Keith Parks <emkxp01@mtcc.demon.co.uk> Subject: Re: [HACKERS] 6.5 cvs: views doesn't survives after pg_dump (fwd) To: pgsql-hackers@postgreSQL.org, oleg@sai.msu.su MIME-Version: 1.0 Content-MD5: 34XqWKKsmVlyonlE1gsMzw== Oleg Bartunov < oleg@sai.msu.su> > After dumping (by pg_dump) and restoring views becomes a tables > The problem is that views are dumped with anm extraneous "WHERE" > ............................ > QUERY: COPY "t1" FROM stdin; > CREATE RULE "_RETv1" AS ON SELECT TO "v1" WHERE DO INSTEAD SELECT "a" FROM "t1"; > QUERY: CREATE RULE "_RETv1" AS ON SELECT TO "v1" WHERE DO INSTEAD SELECT "a" FROM "t1"; ...................................................++++++ > ERROR: parser: parse error at or near "do" > EOF Which causes this error and the rule (View) is not Created. I don't know how the where clause gets in there but if you edit the dump before restoring all is OK. Keith. ------------- End Forwarded Message -------------
В списке pgsql-hackers по дате отправления: