My aim is to edit results of arbitrary query, if sufficient info was selected (or is known): Is that a step towards writeable views?
see Retrieving Query Result Information PQftable and PQftablecol . I claim these are not enough to understan the relation between data in the row (of the result) and it is quite simple to provide further: which columns come from the same tuple in a relation. The server has the plan, and in simple (and most) cases, more columns indeed come from the same tuple.
example:
... see the link below:
In 2004 I attempted to implement this idea: http://archives.postgresql.org/pgsql-general/2004-07/msg00606.php http://archives.postgresql.org/pgsql-general/2004-07/threads.php
patch for 8.1
libpq patch for 8.2 ? postgresql server patch for 8.2?
by studying postgresql/pgsql-server/src/include/nodes/primnodes.h
cd /p/postgresql-7.4.5/work/postgresql-7.4.5/
foreach file (src/backend/access/common/printtup.c src/interfaces/libpq/libpq-fe.h src/interfaces/libpq/fe-exec.c src/interfaces/libpq/libpq-int.h src/interfaces/libpq/fe-protocol3.c)
{
diff --unified -b -B ${file} /p/postgresql-7.4.3-r1/work/postgresql-7.4.3/${file}
}
patch -p0 < /p/pg.patch
gauche-pg builds:
mmc_pg_hack #defined in ok /usr/include/libpq-fe.h bad in /usr/include/postgresql/libpq-fe.h
/p/postgresql-8.1.1/work/postgresql-8.1.1/src/interfaces/libpq/fe-exec.c