Tim Smith <randomdev4+postgres@xxxxxxxxx> writes: > Yes, well PostgreSQL is being incredibly unhelpful in that respect, it > says "(SQLSTATE: 42702 - SQLERRM: column reference "session_id" is > ambiguous)" ... but that is an utter lie. There is only one column > called session_id in my view (in both the view output and the > underlying view query, there is only one reference to "session_id") A reasonably likely bet is that the ambiguity is between a column name exposed by the query and some variable of the same name declared within the plpgsql function. But, as has been mentioned repeatedly, you've not shown us enough detail to permit a positive diagnosis. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general