Re: [SQL] distinguishing identical columns after joins

2011-03-01 Thread Stephen Cook
In times like these, I usually write a query using information_schema.columns to generate the column list: SELECT ordinal_position, 1 AS table_instance, 'a.' || column_name || ' AS ' || column_name || '_a,' FROMINFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'your_table_her

Re: [SQL] statement-level trigger sample out there?

2007-11-29 Thread Stephen Cook
I am curious (coming from a MS SQL Server background, I just started playing with PostgreSQL recently). What type of situation would warrant a statement-level trigger that can't access the old and new values? Without that access, isn't the only information you get is the fact that an operatio