[Mediawiki-l] Bulk Protecting Pages

Ken McDonald ken at pixologic.com
Fri Jun 9 20:10:31 UTC 2006


Someone (Rob, I think, many thanks) advised me a while ago that probably 
the best way to bulk protect pages was to update the page_protections 
column in the page table. The intent is to have a core set of pages that 
anonymous or standard logged in users can read but not edit. So I'll 
have a statement that looks something like this, I think:

UPDATE `page` SET `page_restrictions` = ???,
WHERE `page_namespace` = 0;

The "WHERE" clause is intended to apply the change only to pages in the 
main namespace, so that it only affects the pages we've put up, not 
settings for other built-in MW pages.

Aside from the obvious question of "is this query right (aside from the 
???)", I have two other questions.

1) Does anyone know of any builtin pages in the main namespace that 
might get messed up from having their protection changed?
2) More importantly, what goes into ???, or in general, where do I find 
what constitutes valid values for 'page_restrictions', and how do I 
apply them. phpMyAdmin lists the type of this column as a tinyblob, I 
can't read or manipulate directly in phpMyAdmin (so I can't inspect the 
values currently set for pages), and which I have no idea how to 
manipulate with straight SQL. Nor do I know allowed values or their 
meanings for this field.

Is there documentation anywhere for this? Is this even the correct 
column to do just simple page protection?


Thanks,
Ken

P.S. The list of namespaces on Meta gives the value of the Main 
namespace as {{ns:-0}}. Does the - sign have any significance?




More information about the MediaWiki-l mailing list