Обсуждение: per-session (or persistent) table (and column) aliases

Поиск
Список
Период
Сортировка

per-session (or persistent) table (and column) aliases

От
David Garamond
Дата:
  CREATE TABLE somereallylongname1 (...);
  CREATE TABLEALIAS name1 somereallylongname1;
  SELECT * FROM name1 ...;

Is there such a thing? I know there's alias in SELECT and completion in
psql (or even views). But this is more like a filesystem
symlink/hardlink. Would this be cool/useful?

--
dave


Re: per-session (or persistent) table (and column) aliases

От
Peter Eisentraut
Дата:
David Garamond wrote:
>   CREATE TABLE somereallylongname1 (...);
>   CREATE TABLEALIAS name1 somereallylongname1;
>   SELECT * FROM name1 ...;
>
> Is there such a thing?

A view does exactly what you need.