------=_Part_8905_20948995.1209742469522
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
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
distingui****ng 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
------=_Part_8905_20948995.1209742469522
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
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 distingui****ng table
alias name for that field. For example:<br>
<br>SELECT a.mycolumn, b.mycolumn<br> FROM mytable a, mytable
b<br> WHERE ...<br><br>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.<br>
<br>Cheers,<br> Scott<br>
------=_Part_8905_20948995.1209742469522--


|