Re: Writing and Reading bytea
| От | Heikki Linnakangas |
|---|---|
| Тема | Re: Writing and Reading bytea |
| Дата | |
| Msg-id | 499447ED.20104@enterprisedb.com обсуждение исходный текст |
| Ответ на | Writing and Reading bytea (Amit Gupta <amit.pc.gupta@gmail.com>) |
| Список | pgsql-hackers |
Amit Gupta wrote:
> The following code didn't work:
> ....
> pg_partrel = heap_open(PartitionRelationId, AccessShareLock);
> pg_partscan = systable_beginscan(pg_partrel, PartitionParentIndexId, true,
> SnapshotNow, 1, &skey);
> while (HeapTupleIsValid(pg_parttup= systable_getnext(pg_partscan)))
> {
> Form_pg_partition pg_part = (Form_pg_partition) GETSTRUCT(pg_parttup);
> Datum attr = heap_getattr(tuple, pg_part->partkey, rel->rd_att, &isnull)
> Datum min_part_attr = (Datum) (&pg_part->minval);
> Datum max_part_attr = (Datum) (&pg_part->maxval);
> ......
>
> }
You need to use heap_getattr to access columns after the first variable
length column.
-- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com
В списке pgsql-hackers по дате отправления: