Example code bug: destination->data

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: ray(dot)brinzer(at)gmail(dot)com
Subject: Example code bug: destination->data
Date: 2022-11-08 00:25:37
Message-ID: 166786713708.652.15395196776183543224@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/15/xfunc-c.html
Description:

38.10.2. Base Types in C-Language Functions

In the last example of the section, this line appears:

memcpy(destination->data, buffer, 40);

For me, this gave the following error:

error: ‘text’ {aka ‘struct varlena’} has no member named ‘data’

After tracking down the struct definition, I got the example working with:
destination->vl_dat instead. I assume this is correct, and that the member
name changed somewhere along the way.

--
Ray Brinzer

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message PG Doc comments form 2022-11-08 21:31:15 Possibly Incorrect Data Return
Previous Message Peter Geoghegan 2022-11-08 00:20:18 Re: 64.4.2. Bottom-up Index Deletion