-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 05/29/2013 03:31 PM, Joe Conway wrote:
> On 05/29/2013 07:43 AM, Andres Freund wrote:
>>>>> Couldn't ALTER EXTENSION ... ADD ...; be brought up to
>>>>> speed to support this?
>> Sounds better to me than manually fiddling with pg_depend... We
>> can't really drop and recreate the RULEs, there might be
>> dependencies preventing that.
>
> OK, simple enough. New patch attached. I still need to do some
> testing to verify this does not break anything, but other than
> that, any complaints (including the notion of backpatching this
> back to 9.1)?
Here's a cleaned up version, which also includes documentation. I'll
commit back to 9.1 in a day or two unless there are any objections.
Joe
- --
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJRpodyAAoJEDfy90M199hlpBoP/jOp/KlgZvAL2bOZarTW/Zba
2NMQP3VV3BO7NMO8PcX9xxwZa2zhfCxr2A0GT6IJXgqTDfBCBZLFVsNGPCxS1Yik
DfrhUWxNmyPEIvwVWNCgf2G9UkOcoVLU7ROn000EDly2Fhhi0NTvHWlFWhHaM2kY
64sgjV+b++/JWzWBZntnPZH2VScv9AxaJXqNFV32AADfNOGymc17lTBalnWUzYHE
E1xWn9rZWjM35zEvBpoUcyn3jcf1NryCZIP0HGD3Vn/sW0slltBiAjnjtskhC8iF
iBLcFGvR2jZK9vvry19gVnX5dHTSM71Lxp02+x1KEEMsbqma/VFdtakUSlJUeIWH
ou6ND7lQcriyethluAJ56A4vPyHxzCVjU3aghdQiTuli7lB/2I8GOklhitGz9C2W
/firBDExUd12Um2Fc2zwQzm3s+2Hj3VMR3SVQkbXVfdNAJVqw/QWSeKl3I2CqcJH
mTDNQ9Il8LiOpUUwl9YLEazEyEvlAbfodOl8weO8WBH9QXNm0FXIHdDZeUSSmgY7
7ZHP0IScCNRkF/wxSsWI5VjQtp3GGWeyqYhpuc62CJO8aUICBxeqpB40L11Mplsh
sO8btaIOnZnzKyZqM0fhhT3+y7KbkG59VzuwhXrTV0BvXR7K0McoIJfhI9az6mAf
B5y77JTZL7Ig4HS9IyZD
=Tr4H
-----END PGP SIGNATURE-----
diff --git a/doc/src/sgml/ref/alter_extension.sgml b/doc/src/sgml/ref/alter_extension.sgml
index 2dbba0c..1e9b1c6 100644
*** a/doc/src/sgml/ref/alter_extension.sgml
--- b/doc/src/sgml/ref/alter_extension.sgml
*************** ALTER EXTENSION <replaceable class="PARA
*** 44,49 ****
--- 44,50 ----
OPERATOR CLASS <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> |
OPERATOR FAMILY <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> |
[ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> |
+ RULE <replaceable class="PARAMETER">object_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> |
SCHEMA <replaceable class="PARAMETER">object_name</replaceable> |
SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> |
SERVER <replaceable class="PARAMETER">object_name</replaceable> |
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 73c446a..5fce88b 100644
*** a/src/backend/parser/gram.y
--- b/src/backend/parser/gram.y
*************** AlterExtensionContentsStmt:
*** 3729,3734 ****
--- 3729,3743 ----
n->objargs = list_make1(makeString($9));
$$ = (Node *)n;
}
+ | ALTER EXTENSION name add_drop RULE name ON any_name
+ {
+ AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
+ n->extname = $3;
+ n->action = $4;
+ n->objtype = OBJECT_RULE;
+ n->objname = lappend($8, makeString($6));
+ $$ = (Node *)n;
+ }
| ALTER EXTENSION name add_drop SCHEMA name
{
AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
diff --git a/src/backend/rewrite/rewriteDefine.c b/src/backend/rewrite/rewriteDefine.c
index cb59f13..c48c661 100644
*** a/src/backend/rewrite/rewriteDefine.c
--- b/src/backend/rewrite/rewriteDefine.c
*************** InsertRule(char *rulname,
*** 181,186 ****
--- 181,189 ----
DEPENDENCY_NORMAL);
}
+ /* dependency on extension */
+ recordDependencyOnCurrentExtension(&myself, is_update);
+
/* Post creation hook for new rule */
InvokeObjectPostCreateHook(RewriteRelationId, rewriteObjectId, 0);
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers