<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.sqle.ru/index.php?action=history&amp;feed=atom&amp;title=PostgreSQL%2FConstraints%2FCreate_Rule</id>
		<title>PostgreSQL/Constraints/Create Rule - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.sqle.ru/index.php?action=history&amp;feed=atom&amp;title=PostgreSQL%2FConstraints%2FCreate_Rule"/>
		<link rel="alternate" type="text/html" href="http://www.sqle.ru/index.php?title=PostgreSQL/Constraints/Create_Rule&amp;action=history"/>
		<updated>2026-04-04T16:33:01Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.sqle.ru/index.php?title=PostgreSQL/Constraints/Create_Rule&amp;diff=4968&amp;oldid=prev</id>
		<title> в 13:45, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.sqle.ru/index.php?title=PostgreSQL/Constraints/Create_Rule&amp;diff=4968&amp;oldid=prev"/>
				<updated>2010-05-26T13:45:56Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 13:45, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.sqle.ru/index.php?title=PostgreSQL/Constraints/Create_Rule&amp;diff=4969&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.sqle.ru/index.php?title=PostgreSQL/Constraints/Create_Rule&amp;diff=4969&amp;oldid=prev"/>
				<updated>2010-05-26T10:14:32Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==CREATE OR REPLACE RULE==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# CREATE TABLE measurement (&lt;br /&gt;
postgres(#    city_id         int not null,&lt;br /&gt;
postgres(#    logdate         date not null,&lt;br /&gt;
postgres(#    peaktemp        int,&lt;br /&gt;
postgres(#    unitsales       int&lt;br /&gt;
postgres(# );&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# CREATE TABLE measurement_yy04mm02 (&lt;br /&gt;
postgres(#     CHECK ( logdate &amp;gt;= DATE &amp;quot;2004-02-01&amp;quot; AND logdate &amp;lt; DATE &amp;quot;2004-03-01&amp;quot; )&lt;br /&gt;
postgres(# ) INHERITS (measurement);&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# CREATE TABLE measurement_yy04mm03 (&lt;br /&gt;
postgres(#     CHECK ( logdate &amp;gt;= DATE &amp;quot;2004-03-01&amp;quot; AND logdate &amp;lt; DATE &amp;quot;2004-04-01&amp;quot; )&lt;br /&gt;
postgres(# ) INHERITS (measurement);&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# CREATE OR REPLACE RULE measurement_current_partition AS&lt;br /&gt;
postgres-# ON INSERT TO measurement&lt;br /&gt;
postgres-# DO INSTEAD&lt;br /&gt;
postgres-#    INSERT INTO measurement_yy06mm01 VALUES ( NEW.city_id,&lt;br /&gt;
postgres(#                                              NEW.logdate,&lt;br /&gt;
postgres(#                                              NEW.peaktemp,&lt;br /&gt;
postgres(#                                              NEW.unitsales );&lt;br /&gt;
ERROR:  relation &amp;quot;measurement_yy06mm01&amp;quot; does not exist&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# CREATE RULE measurement_insert_yy04mm02 AS&lt;br /&gt;
postgres-# ON INSERT TO measurement WHERE&lt;br /&gt;
postgres-#     ( logdate &amp;gt;= DATE &amp;quot;2004-02-01&amp;quot; AND logdate &amp;lt; DATE &amp;quot;2004-03-01&amp;quot; )&lt;br /&gt;
postgres-# DO INSTEAD&lt;br /&gt;
postgres-#     INSERT INTO measurement_yy04mm02 VALUES ( NEW.city_id,&lt;br /&gt;
postgres(#                                               NEW.logdate,&lt;br /&gt;
postgres(#                                               NEW.peaktemp,&lt;br /&gt;
postgres(#                                               NEW.unitsales );&lt;br /&gt;
CREATE RULE&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# CREATE VIEW allmeasurement AS&lt;br /&gt;
postgres-# SELECT * FROM measurement_yy04mm02&lt;br /&gt;
postgres-# UNION ALL&lt;br /&gt;
postgres-# SELECT * FROM measurement_yy04mm03;&lt;br /&gt;
CREATE VIEW&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# drop view allmeasurement cascade;&lt;br /&gt;
DROP VIEW&lt;br /&gt;
postgres=# drop table measurement_yy04mm02 cascade;&lt;br /&gt;
NOTICE:  drop cascades to rule measurement_insert_yy04mm02 on table measurement&lt;br /&gt;
DROP TABLE&lt;br /&gt;
postgres=# drop table measurement_yy04mm03 cascade;&lt;br /&gt;
DROP TABLE&lt;br /&gt;
postgres=# drop table measurement cascade;&lt;br /&gt;
DROP TABLE&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=#&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>