[postgis-users] create tables smarter
Kevin Neufeld
kneufeld at refractions.net
Wed Jun 4 15:38:39 PDT 2008
Chris Hermansen wrote:
...
> OK, so far, so good. Let's try the same thing with pg_tables:
>
> clh=# drop rule table_rule on data;
> DROP RULE
> clh=# drop table tracks;
> DROP TABLE
> clh=# drop table data;
> DROP TABLE
> clh=# create table tracks (tablename name);
> CREATE TABLE
> clh=# create rule table_rule as on insert to pg_tables do also
> insert into tracks values (new.tablename);
> CREATE RULE
> clh=# create table fink (a int, b text);
> CREATE TABLE
> clh=# create table zink (c float, d date);
> CREATE TABLE
> clh=# select * from tracks;
> tablename
> -----------
> (0 rows)
>
> clh=#
>
>
> Well, so much for that idea. We can create rules on system tables, they
> just don't work.
>
> Bummer.
>
Just thought I'd point out Chris that pg_tables is a view, not a system
table. For kicks, try your rule on pg_class.
-- Kevin
More information about the postgis-users
mailing list