From: | "Scott Miller" <smiller(at)duels(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Feature request |
Date: | 2008-05-02 15:34:29 |
Message-ID: | 76bb504a0805020834o1b91413al3464f45fe170f0c5@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
One problem I've had in development recently is the inability to get the
aliased name of a table from a query. We're using a PHP framework for
querying, which internally uses pg_field_name to retrieve the select list
field name, which is great. There is alwo pg_table_name, to retrieve the
table the field originated from. The problem is that this returns the name
of the table, unaliased. If a query does a self join, you can't retrieve a
distinguishing table alias name for that field. For example:
SELECT a.mycolumn, b.mycolumn
FROM mytable a, mytable b
WHERE ...
If I controlled query generation at all times, I could simply alias
a.mycolumn and b.mycolumn differently in the select list. But if for
example this is SELECT * FROM, those columns are indistinguishable.
Cheers,
Scott
From | Date | Subject | |
---|---|---|---|
Next Message | Nathan Thatcher | 2008-05-02 15:34:31 | User Defined C Function with minGW |
Previous Message | Glyn Astill | 2008-05-02 15:14:24 | Re: Autovacuum |