---
title: "ALTER RULE"
source: https://cloudberry.apache.org/docs/sql-stmts/alter-rule
---

# ALTER RULE

Changes the definition of a rule.

## Synopsis

```sql
ALTER RULE name ON <table_name> RENAME TO <new_name>
```

## Description

`ALTER RULE` changes properties of an existing rule. Currently, the only available action is to change the rule's name.

To use `ALTER RULE`, you must own the table or view that the rule applies to.

## Parameters

**`name`**

The name of an existing rule to alter.

**`table_name`**

The name (optionally schema-qualified) of the table or view that the rule applies to.

**`new_name`**

The new name for the rule.

## Examples

To rename an existing rule:

```sql
ALTER RULE notify_all ON emp RENAME TO notify_me; 
```

## Compatibility

`ALTER RULE` is a Apache Cloudberry extension, as is the entire query rewrite system.

## See also

[`CREATE RULE`](/docs/sql-stmts/create-rule.md), [`DROP RULE`](/docs/sql-stmts/drop-rule.md)
