Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

why "alter table" to change owner of sequence?


  • From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
  • To: pgsql-bugs(at)postgresql(dot)org
  • Subject: why "alter table" to change owner of sequence?
  • Date: Mon, 10 Dec 2007 11:12:13 +0100
  • Message-id: <20071210101213(dot)GA30552(at)depesz(dot)com>

if i create sequence m and then want to change it's owner to some other
account i have to issue:
alter table <sequence_name> owner to ...;

why can't it be: alter sequence?

example:

# create sequence x;
CREATE SEQUENCE

# \d
         List of relations
 Schema | Name |   Type   | Owner
--------+------+----------+--------
 public | x    | sequence | depesz
(1 row)

# alter sequence x owner to pgdba;
ERROR:  syntax error at or near "owner"
LINE 1: alter sequence x owner to pgdba;
                         ^
# alter table x owner to pgdba;
ALTER TABLE

# \d
        List of relations
 Schema | Name |   Type   | Owner
--------+------+----------+-------
 public | x    | sequence | pgdba
(1 row)

depesz

-- 
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA.  here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group