cpostgresqlpostgresql-extensions

Compiling PostgreSQL extension, getting "error: ‘work_mem’ undeclared (first use in this function)"


When I compile the extension I've got, I'm getting

error: ‘work_mem’ undeclared (first use in this function)
   17 |   Tuplestorestate *tupstore = tuplestore_begin_heap(true, false, work_mem);

What header includes work_mem?


Solution

  • The work_mem symbol is provided by misadmin.h you will have to add that header into your .c file.

    #include "miscadmin.h"