You should read the documentation for the current version.
Yes.
As the example shows, with GetAttributeByName
, but there is also a GetAttributeByNum
function. I assume you are talking about a C array and not a PostgreSQL array. You can stuff all the values into an array, sure, if they have the same data type.
Then you would have to use the special type record
. For a code sample, look at the functions record_to_json
and composite_to_json
in src/backend/utils/adt/json.c
.
It is called for each row found, since it appears in the SELECT
list.
That's a bit vague, but sure. I don't see why you'd want to extract that from a table though. Why not write your own table access method, since it looks like you want to define a new way of storing tables.
But be warned, that would be decidedly non-trivial, and you'd better first get your feet wet with more mundane stuff.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…