Create Alias for PostgreSQL Table

前端 未结 3 2299
被撕碎了的回忆
被撕碎了的回忆 2021-02-19 19:57

I have a table called assignments. I would like to be able to read/write to all the columns in this table using either assignments.column or homework.column, how can I do this?<

3条回答
  •  生来不讨喜
    2021-02-19 20:37

    With Postgres 9.3 the following should be enough:

    CREATE VIEW homework AS SELECT * FROM assignments;

    It works because simple views are automatically updatable (see docs).

提交回复
热议问题