[BUGS] BUG #8176: problem with the ALTER TYPE name RENAME TO new_name [ CASCADE | RESTRICT ] syntax

2013-05-27 Thread maxim . boguk
The following bug has been logged on the website:

Bug reference:  8176
Logged by:  Maksym Boguk
Email address:  maxim.bo...@gmail.com
PostgreSQL version: 9.2.4
Operating system:   Any
Description:

Hi,

It seems that documentation wrong or [ CASCADE | RESTRICT ] feature of ALTER
TYPE ... RENAME TO isn't implemented.

Test case:

create type test as (qqq integer);
CREATE TYPE

alter type test rename to test1 RESTRICT;
ERROR:  syntax error at or near RESTRICT
LINE 1: alter type test rename to test1 RESTRICT;
^

alter type test rename to test1 CASCADE;
ERROR:  syntax error at or near CASCADE
LINE 1: alter type test rename to test1 CASCADE;
^

However:
[local]:5432 postgres@postgres=# alter type test rename to test1;
ALTER TYPE




-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


Re: [BUGS] BUG #8176: problem with the ALTER TYPE name RENAME TO new_name [ CASCADE | RESTRICT ] syntax

2013-05-27 Thread Stephen Frost
Maxim,

* maxim.bo...@gmail.com (maxim.bo...@gmail.com) wrote:
 It seems that documentation wrong or [ CASCADE | RESTRICT ] feature of ALTER
 TYPE ... RENAME TO isn't implemented.

Actually, I'm pretty sure it's implemented but the grammar for it was
broken during refactoring to have all the ALTER .. RENAME operations go
through the same code paths.

 Test case:

Thanks for this.  I'm working on fixing this and will also add
regression tests to, hopefully, avoid this getting broken in the future.

Thanks again,

Stephen


signature.asc
Description: Digital signature


Re: [BUGS] BUG #8176: problem with the ALTER TYPE name RENAME TO new_name [ CASCADE | RESTRICT ] syntax

2013-05-27 Thread Tom Lane
Stephen Frost sfr...@snowman.net writes:
 * maxim.bo...@gmail.com (maxim.bo...@gmail.com) wrote:
 It seems that documentation wrong or [ CASCADE | RESTRICT ] feature of ALTER
 TYPE ... RENAME TO isn't implemented.

 Actually, I'm pretty sure it's implemented but the grammar for it was
 broken during refactoring to have all the ALTER .. RENAME operations go
 through the same code paths.

Are we sure the documentation's not wrong?  A quick test says this
syntax isn't accepted in *any* existing release, and I can't say I
understand what it should do anyway.

regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


Re: [BUGS] BUG #8176: problem with the ALTER TYPE name RENAME TO new_name [ CASCADE | RESTRICT ] syntax

2013-05-27 Thread Stephen Frost
Maxim,

* Stephen Frost (sfr...@snowman.net) wrote:
 * maxim.bo...@gmail.com (maxim.bo...@gmail.com) wrote:
  It seems that documentation wrong or [ CASCADE | RESTRICT ] feature of ALTER
  TYPE ... RENAME TO isn't implemented.
 
 Actually, I'm pretty sure it's implemented but the grammar for it was
 broken during refactoring to have all the ALTER .. RENAME operations go
 through the same code paths.

Nope, I was wrong- this looks to be a documentation bug, actually.  The
documentation should be:

ALTER TYPE name RENAME ATTRIBUTE attribute_name TO new_attribute_name [ CASCADE 
| RESTRICT ]
ALTER TYPE name RENAME TO new_name

Which makes more sense (to me at least) anyway.  Do you have a need for
this version:

ALTER TYPE name RENAME TO new_name [ CASCADE | RESTRICT ]

or were you just playing with things..?

Thanks,

Stephen


signature.asc
Description: Digital signature


Re: [BUGS] BUG #8176: problem with the ALTER TYPE name RENAME TO new_name [ CASCADE | RESTRICT ] syntax

2013-05-27 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote:
 Are we sure the documentation's not wrong?  A quick test says this
 syntax isn't accepted in *any* existing release, and I can't say I
 understand what it should do anyway.

Was just composing an email to that effect, actually.  I agree that it's
a documentation issue.  Of course, that makes it easier to fix. :)

Thanks,

Stephen


signature.asc
Description: Digital signature


Re: [BUGS] BUG #8176: problem with the ALTER TYPE name RENAME TO new_name [ CASCADE | RESTRICT ] syntax

2013-05-27 Thread Stephen Frost
Maxim,

* maxim.bo...@gmail.com (maxim.bo...@gmail.com) wrote:
 It seems that documentation wrong or [ CASCADE | RESTRICT ] feature of ALTER
 TYPE ... RENAME TO isn't implemented.

I've updated the documentation to reflect that [ CASCADE | RESTRICT ] is
supported for ALTER TYPE .. RENAME ATTRIBUTE and that it isn't supported
for ALTER TYPE .. RENAME TO.  This update will be pushed out with the
next releases.

Thanks!

Stephen


signature.asc
Description: Digital signature