Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename and schema move support #13

Open
eulerto opened this issue Jan 23, 2016 · 0 comments
Open

rename and schema move support #13

eulerto opened this issue Jan 23, 2016 · 0 comments

Comments

@eulerto
Copy link
Owner

eulerto commented Jan 23, 2016

If we rename an object or attribute there isn't a way to know that 'foo' becomes 'bar' unless (i) we have a discovery algorithm (that can't be precise -- e.g. rename a table, rename a column and add another column) or (ii) tell explicitly that 'foo' is now 'bar'. AFAICS (ii) is the right way to solve this problem.

OP should explicity inform in configuration file that 'foo' becomes 'bar'. One idea is a 'transform' section that contains option=value pairs. Each pair has option (object or attribute -- goal is identify the object) and a value (indeed two values separated by comma). An example:

[transform]
table=foo, bar ; ALTER TABLE foo RENAME to bar
attribute=teste.a, teste.b ; ALTER TABLE teste RENAME COLUMN a TO b
schema=adm, rh ; ALTER SCHEMA adm RENAME TO rh
table=adm.foo, rh.foo ; ALTER TABLE adm.foo SET SCHEMA TO rh
function=adm.foo(integer), bar ; ALTER FUNCTION adm.foo(integer) RENAME TO bar

  • schema could be omitted for objects?
  • disallow different schemas unless in 'schema' option?
  • double quote if name contains comma

It should support:

RENAME TO / SET SCHEMA

  • AGGREGATE
  • COLLATION
  • CONVERSION
  • DOMAIN
  • (FOREIGN) TABLE
  • FUNCTION
  • MATERIALIZED VIEW
  • OPERATOR CLASS
  • OPERATOR FAMILY
  • SEQUENCE
  • ALTER TEXT SEARCH CONFIGURATION
  • ALTER TEXT SEARCH DICTIONARY
  • ALTER TEXT SEARCH PARSER
  • ALTER TEXT SEARCH TEMPLATE
  • TYPE
  • VIEW

RENAME

  • DOMAIN: constraint
  • EVENT TRIGGER
  • FOREIGN DATA WRAPPER
  • INDEX
  • LANGUAGE
  • MATERIALIZED VIEW: column
  • ROLE
  • RULE
  • SCHEMA
  • SERVER
  • TABLE: column
  • TABLESPACE
  • TRIGGER
  • TYPE: column

MOVE SCHEMA

  • EXTENSION
  • OPERATOR
eulerto pushed a commit that referenced this issue Mar 13, 2018
Rename an object is not supported yet as described by issue #13.

Reported by @rafalcieslak (issue #39)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant