pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: ray.brinzer@gmail.com
Subject: Example code bug:  destination->data
Date: Tue, 08 Nov 2022 00:25:37 +0000
Message-ID: <166786713708.652.15395196776183543224@wrigleys.postgresql.org> (raw)

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


view thread (2+ messages)  latest in thread

Message-ID: <166786713708.652.15395196776183543224@wrigleys.postgresql.org>
Permalink:  ../166786713708.652.15395196776183543224@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/166786713708.652.15395196776183543224@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, ray.brinzer@gmail.com
  Subject: Re: Example code bug:  destination->data
  In-Reply-To: <166786713708.652.15395196776183543224@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox