giladrv
giladrv

Reputation: 1132

Is it possible to create a global alias for a table in psql?

We have a table called Table1, and we want to create an alias for it, e.g. Table2, so that in any query it is understood as Table1. Is it possible in psql?

Upvotes: 6

Views: 2259

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1270431

You can use a view:

create view table2 as
     select * from table1;

Upvotes: 7

Related Questions