Re: Mimic ALIAS in Postgresql?
От | Rob Sargent |
---|---|
Тема | Re: Mimic ALIAS in Postgresql? |
Дата | |
Msg-id | 484b48cd-3a6e-4585-be9b-febed445e18b@gmail.com обсуждение исходный текст |
Ответ на | Mimic ALIAS in Postgresql? (Ron Johnson <ronljohnsonjr@gmail.com>) |
Ответы |
Re: Mimic ALIAS in Postgresql?
|
Список | pgsql-general |
On 1/16/24 10:20, Ron Johnson wrote:
Isn't it time to get rid of that debt? A sed -i 's/MTUSER/MTQRY/g' (or vice versa) ends what looks to me to be a split brain problem. All the sql is in git right? :)Some RDBMSs have CREATE ALIAS, which allows you to refer to a table by a different name (while also referring to it by the original name).We have an application running on DB2/UDB which (for reasons wholly unknown to me, and probably also to the current developer) extensively uses this with two schemas: MTUSER and MTQRY. For example, sometimes refer to MTUSER.sometable and other times refer to it as MYQRY.sometable.My goal is to present a way to migrate from UDB to PG with as few application changes as possible. Thus, the need to mimic aliases.Maybe updatable views?CREATE VIEW mtqry.sometable AS SELECT * FROM mtuser.sometable;
Or perhaps you have to beef the sed up to use word boundaries just in case.
В списке pgsql-general по дате отправления: