PostgreSQL Source Code  git master
pg_publication.h File Reference
#include "catalog/genbki.h"
#include "catalog/pg_publication_d.h"
#include "catalog/objectaddress.h"
Include dependency graph for pg_publication.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PublicationActions
 
struct  Publication
 

Typedefs

typedef FormData_pg_publicationForm_pg_publication
 
typedef struct PublicationActions PublicationActions
 
typedef struct Publication Publication
 

Functions

 CATALOG (pg_publication, 6104, PublicationRelationId)
 
PublicationGetPublication (Oid pubid)
 
PublicationGetPublicationByName (const char *pubname, bool missing_ok)
 
ListGetRelationPublications (Oid relid)
 
ListGetPublicationRelations (Oid pubid)
 
ListGetAllTablesPublications (void)
 
ListGetAllTablesPublicationRelations (void)
 
bool is_publishable_relation (Relation rel)
 
ObjectAddress publication_add_relation (Oid pubid, Relation targetrel, bool if_not_exists)
 
Oid get_publication_oid (const char *pubname, bool missing_ok)
 
char * get_publication_name (Oid pubid, bool missing_ok)
 

Variables

 FormData_pg_publication
 

Typedef Documentation

◆ Form_pg_publication

Definition at line 63 of file pg_publication.h.

◆ Publication

typedef struct Publication Publication

◆ PublicationActions

Function Documentation

◆ CATALOG()

CATALOG ( pg_publication  ,
6104  ,
PublicationRelationId   
)

Definition at line 30 of file pg_publication.h.

31 {
32  Oid oid; /* oid */
33 
34  NameData pubname; /* name of the publication */
35 
36  Oid pubowner; /* publication owner */
37 
38  /*
39  * indicates that this is special publication which should encompass all
40  * tables in the database (except for the unlogged and temp ones)
41  */
42  bool puballtables;
43 
44  /* true if inserts are published */
45  bool pubinsert;
46 
47  /* true if updates are published */
48  bool pubupdate;
49 
50  /* true if deletes are published */
51  bool pubdelete;
52 
53  /* true if truncates are published */
54  bool pubtruncate;
55 
unsigned int Oid
Definition: postgres_ext.h:31
FormData_pg_publication
Definition: c.h:604

◆ get_publication_name()

char* get_publication_name ( Oid  pubid,
bool  missing_ok 
)

Definition at line 448 of file pg_publication.c.

References elog, ERROR, GETSTRUCT, HeapTupleIsValid, NameStr, ObjectIdGetDatum, pstrdup(), PUBLICATIONOID, ReleaseSysCache(), and SearchSysCache1().

Referenced by getObjectDescription(), and getObjectIdentityParts().

449 {
450  HeapTuple tup;
451  char *pubname;
452  Form_pg_publication pubform;
453 
455 
456  if (!HeapTupleIsValid(tup))
457  {
458  if (!missing_ok)
459  elog(ERROR, "cache lookup failed for publication %u", pubid);
460  return NULL;
461  }
462 
463  pubform = (Form_pg_publication) GETSTRUCT(tup);
464  pubname = pstrdup(NameStr(pubform->pubname));
465 
466  ReleaseSysCache(tup);
467 
468  return pubname;
469 }
#define GETSTRUCT(TUP)
Definition: htup_details.h:655
char * pstrdup(const char *in)
Definition: mcxt.c:1186
#define ObjectIdGetDatum(X)
Definition: postgres.h:507
#define ERROR
Definition: elog.h:43
HeapTuple SearchSysCache1(int cacheId, Datum key1)
Definition: syscache.c:1116
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1164
#define HeapTupleIsValid(tuple)
Definition: htup.h:78
#define elog(elevel,...)
Definition: elog.h:228
#define NameStr(name)
Definition: c.h:610
FormData_pg_publication * Form_pg_publication

◆ get_publication_oid()

Oid get_publication_oid ( const char *  pubname,
bool  missing_ok 
)

Definition at line 428 of file pg_publication.c.

References CStringGetDatum, ereport, errcode(), errmsg(), ERROR, GetSysCacheOid1, OidIsValid, and PUBLICATIONNAME.

Referenced by get_object_address_unqualified().

429 {
430  Oid oid;
431 
432  oid = GetSysCacheOid1(PUBLICATIONNAME, Anum_pg_publication_oid,
433  CStringGetDatum(pubname));
434  if (!OidIsValid(oid) && !missing_ok)
435  ereport(ERROR,
436  (errcode(ERRCODE_UNDEFINED_OBJECT),
437  errmsg("publication \"%s\" does not exist", pubname)));
438  return oid;
439 }
#define GetSysCacheOid1(cacheId, oidcol, key1)
Definition: syscache.h:192
int errcode(int sqlerrcode)
Definition: elog.c:608
unsigned int Oid
Definition: postgres_ext.h:31
#define OidIsValid(objectId)
Definition: c.h:639
#define ERROR
Definition: elog.h:43
#define CStringGetDatum(X)
Definition: postgres.h:578
#define ereport(elevel, rest)
Definition: elog.h:141
int errmsg(const char *fmt,...)
Definition: elog.c:822

◆ GetAllTablesPublicationRelations()

List* GetAllTablesPublicationRelations ( void  )

Definition at line 332 of file pg_publication.c.

References AccessShareLock, BTEqualStrategyNumber, CharGetDatum, ForwardScanDirection, GETSTRUCT, heap_getnext(), is_publishable_class(), sort-test::key, lappend_oid(), NIL, ScanKeyInit(), table_beginscan_catalog(), table_close(), table_endscan(), and table_open().

Referenced by pg_get_publication_tables().

333 {
334  Relation classRel;
335  ScanKeyData key[1];
336  TableScanDesc scan;
337  HeapTuple tuple;
338  List *result = NIL;
339 
340  classRel = table_open(RelationRelationId, AccessShareLock);
341 
342  ScanKeyInit(&key[0],
343  Anum_pg_class_relkind,
344  BTEqualStrategyNumber, F_CHAREQ,
345  CharGetDatum(RELKIND_RELATION));
346 
347  scan = table_beginscan_catalog(classRel, 1, key);
348 
349  while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
350  {
351  Form_pg_class relForm = (Form_pg_class) GETSTRUCT(tuple);
352  Oid relid = relForm->oid;
353 
354  if (is_publishable_class(relid, relForm))
355  result = lappend_oid(result, relid);
356  }
357 
358  table_endscan(scan);
359  table_close(classRel, AccessShareLock);
360 
361  return result;
362 }
#define NIL
Definition: pg_list.h:65
void table_close(Relation relation, LOCKMODE lockmode)
Definition: table.c:133
#define GETSTRUCT(TUP)
Definition: htup_details.h:655
TableScanDesc table_beginscan_catalog(Relation relation, int nkeys, struct ScanKeyData *key)
Definition: tableam.c:98
#define AccessShareLock
Definition: lockdefs.h:36
unsigned int Oid
Definition: postgres_ext.h:31
List * lappend_oid(List *list, Oid datum)
Definition: list.c:358
HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction)
Definition: heapam.c:1290
#define CharGetDatum(X)
Definition: postgres.h:416
static void table_endscan(TableScanDesc scan)
Definition: tableam.h:831
FormData_pg_class * Form_pg_class
Definition: pg_class.h:150
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
Definition: scankey.c:76
static bool is_publishable_class(Oid relid, Form_pg_class reltuple)
Relation table_open(Oid relationId, LOCKMODE lockmode)
Definition: table.c:39
Definition: pg_list.h:50
#define BTEqualStrategyNumber
Definition: stratnum.h:31

◆ GetAllTablesPublications()

List* GetAllTablesPublications ( void  )

Definition at line 295 of file pg_publication.c.

References AccessShareLock, BoolGetDatum, BTEqualStrategyNumber, GETSTRUCT, HeapTupleIsValid, InvalidOid, lappend_oid(), NIL, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().

Referenced by GetRelationPublicationActions().

296 {
297  List *result;
298  Relation rel;
299  ScanKeyData scankey;
300  SysScanDesc scan;
301  HeapTuple tup;
302 
303  /* Find all publications that are marked as for all tables. */
304  rel = table_open(PublicationRelationId, AccessShareLock);
305 
306  ScanKeyInit(&scankey,
307  Anum_pg_publication_puballtables,
308  BTEqualStrategyNumber, F_BOOLEQ,
309  BoolGetDatum(true));
310 
311  scan = systable_beginscan(rel, InvalidOid, false,
312  NULL, 1, &scankey);
313 
314  result = NIL;
315  while (HeapTupleIsValid(tup = systable_getnext(scan)))
316  {
317  Oid oid = ((Form_pg_publication) GETSTRUCT(tup))->oid;
318 
319  result = lappend_oid(result, oid);
320  }
321 
322  systable_endscan(scan);
324 
325  return result;
326 }
#define NIL
Definition: pg_list.h:65
void table_close(Relation relation, LOCKMODE lockmode)
Definition: table.c:133
void systable_endscan(SysScanDesc sysscan)
Definition: genam.c:525
#define GETSTRUCT(TUP)
Definition: htup_details.h:655
#define AccessShareLock
Definition: lockdefs.h:36
unsigned int Oid
Definition: postgres_ext.h:31
List * lappend_oid(List *list, Oid datum)
Definition: list.c:358
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
Definition: genam.c:352
HeapTuple systable_getnext(SysScanDesc sysscan)
Definition: genam.c:444
#define BoolGetDatum(X)
Definition: postgres.h:402
#define InvalidOid
Definition: postgres_ext.h:36
#define HeapTupleIsValid(tuple)
Definition: htup.h:78
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
Definition: scankey.c:76
FormData_pg_publication * Form_pg_publication
Relation table_open(Oid relationId, LOCKMODE lockmode)
Definition: table.c:39
Definition: pg_list.h:50
#define BTEqualStrategyNumber
Definition: stratnum.h:31

◆ GetPublication()

Publication* GetPublication ( Oid  pubid)

Definition at line 370 of file pg_publication.c.

References Publication::alltables, elog, ERROR, GETSTRUCT, HeapTupleIsValid, Publication::name, NameStr, ObjectIdGetDatum, Publication::oid, palloc(), pstrdup(), Publication::pubactions, PublicationActions::pubdelete, PublicationActions::pubinsert, PUBLICATIONOID, PublicationActions::pubtruncate, PublicationActions::pubupdate, ReleaseSysCache(), and SearchSysCache1().

Referenced by GetPublicationByName(), and publication_add_relation().

371 {
372  HeapTuple tup;
373  Publication *pub;
374  Form_pg_publication pubform;
375 
377 
378  if (!HeapTupleIsValid(tup))
379  elog(ERROR, "cache lookup failed for publication %u", pubid);
380 
381  pubform = (Form_pg_publication) GETSTRUCT(tup);
382 
383  pub = (Publication *) palloc(sizeof(Publication));
384  pub->oid = pubid;
385  pub->name = pstrdup(NameStr(pubform->pubname));
386  pub->alltables = pubform->puballtables;
387  pub->pubactions.pubinsert = pubform->pubinsert;
388  pub->pubactions.pubupdate = pubform->pubupdate;
389  pub->pubactions.pubdelete = pubform->pubdelete;
390  pub->pubactions.pubtruncate = pubform->pubtruncate;
391 
392  ReleaseSysCache(tup);
393 
394  return pub;
395 }
PublicationActions pubactions
#define GETSTRUCT(TUP)
Definition: htup_details.h:655
char * pstrdup(const char *in)
Definition: mcxt.c:1186
#define ObjectIdGetDatum(X)
Definition: postgres.h:507
#define ERROR
Definition: elog.h:43
HeapTuple SearchSysCache1(int cacheId, Datum key1)
Definition: syscache.c:1116
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1164
#define HeapTupleIsValid(tuple)
Definition: htup.h:78
void * palloc(Size size)
Definition: mcxt.c:949
#define elog(elevel,...)
Definition: elog.h:228
#define NameStr(name)
Definition: c.h:610
FormData_pg_publication * Form_pg_publication

◆ GetPublicationByName()

Publication* GetPublicationByName ( const char *  pubname,
bool  missing_ok 
)

Definition at line 402 of file pg_publication.c.

References CStringGetDatum, ereport, errcode(), errmsg(), ERROR, GetPublication(), GetSysCacheOid1, OidIsValid, and PUBLICATIONNAME.

Referenced by get_object_address_publication_rel(), LoadPublications(), and pg_get_publication_tables().

403 {
404  Oid oid;
405 
406  oid = GetSysCacheOid1(PUBLICATIONNAME, Anum_pg_publication_oid,
407  CStringGetDatum(pubname));
408  if (!OidIsValid(oid))
409  {
410  if (missing_ok)
411  return NULL;
412 
413  ereport(ERROR,
414  (errcode(ERRCODE_UNDEFINED_OBJECT),
415  errmsg("publication \"%s\" does not exist", pubname)));
416  }
417 
418  return GetPublication(oid);
419 }
#define GetSysCacheOid1(cacheId, oidcol, key1)
Definition: syscache.h:192
int errcode(int sqlerrcode)
Definition: elog.c:608
unsigned int Oid
Definition: postgres_ext.h:31
#define OidIsValid(objectId)
Definition: c.h:639
Publication * GetPublication(Oid pubid)
#define ERROR
Definition: elog.h:43
#define CStringGetDatum(X)
Definition: postgres.h:578
#define ereport(elevel, rest)
Definition: elog.h:141
int errmsg(const char *fmt,...)
Definition: elog.c:822

◆ GetPublicationRelations()

List* GetPublicationRelations ( Oid  pubid)

Definition at line 256 of file pg_publication.c.

References AccessShareLock, BTEqualStrategyNumber, GETSTRUCT, HeapTupleIsValid, lappend_oid(), NIL, ObjectIdGetDatum, PublicationRelPrrelidPrpubidIndexId, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().

Referenced by AlterPublicationOptions(), AlterPublicationTables(), and pg_get_publication_tables().

257 {
258  List *result;
259  Relation pubrelsrel;
260  ScanKeyData scankey;
261  SysScanDesc scan;
262  HeapTuple tup;
263 
264  /* Find all publications associated with the relation. */
265  pubrelsrel = table_open(PublicationRelRelationId, AccessShareLock);
266 
267  ScanKeyInit(&scankey,
268  Anum_pg_publication_rel_prpubid,
269  BTEqualStrategyNumber, F_OIDEQ,
270  ObjectIdGetDatum(pubid));
271 
273  true, NULL, 1, &scankey);
274 
275  result = NIL;
276  while (HeapTupleIsValid(tup = systable_getnext(scan)))
277  {
279 
280  pubrel = (Form_pg_publication_rel) GETSTRUCT(tup);
281 
282  result = lappend_oid(result, pubrel->prrelid);
283  }
284 
285  systable_endscan(scan);
286  table_close(pubrelsrel, AccessShareLock);
287 
288  return result;
289 }
#define NIL
Definition: pg_list.h:65
void table_close(Relation relation, LOCKMODE lockmode)
Definition: table.c:133
void systable_endscan(SysScanDesc sysscan)
Definition: genam.c:525
#define GETSTRUCT(TUP)
Definition: htup_details.h:655
#define AccessShareLock
Definition: lockdefs.h:36
List * lappend_oid(List *list, Oid datum)
Definition: list.c:358
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
Definition: genam.c:352
HeapTuple systable_getnext(SysScanDesc sysscan)
Definition: genam.c:444
#define ObjectIdGetDatum(X)
Definition: postgres.h:507
#define PublicationRelPrrelidPrpubidIndexId
Definition: indexing.h:358
#define HeapTupleIsValid(tuple)
Definition: htup.h:78
FormData_pg_publication_rel * Form_pg_publication_rel
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
Definition: scankey.c:76
Relation table_open(Oid relationId, LOCKMODE lockmode)
Definition: table.c:39
Definition: pg_list.h:50
#define BTEqualStrategyNumber
Definition: stratnum.h:31

◆ GetRelationPublications()

List* GetRelationPublications ( Oid  relid)

Definition at line 227 of file pg_publication.c.

References GETSTRUCT, i, lappend_oid(), catclist::members, catclist::n_members, NIL, ObjectIdGetDatum, PUBLICATIONRELMAP, ReleaseSysCacheList, SearchSysCacheList1, and catctup::tuple.

Referenced by ATPrepChangePersistence(), get_rel_sync_entry(), and GetRelationPublicationActions().

228 {
229  List *result = NIL;
230  CatCList *pubrellist;
231  int i;
232 
233  /* Find all publications associated with the relation. */
235  ObjectIdGetDatum(relid));
236  for (i = 0; i < pubrellist->n_members; i++)
237  {
238  HeapTuple tup = &pubrellist->members[i]->tuple;
239  Oid pubid = ((Form_pg_publication_rel) GETSTRUCT(tup))->prpubid;
240 
241  result = lappend_oid(result, pubid);
242  }
243 
244  ReleaseSysCacheList(pubrellist);
245 
246  return result;
247 }
#define NIL
Definition: pg_list.h:65
int n_members
Definition: catcache.h:176
#define GETSTRUCT(TUP)
Definition: htup_details.h:655
unsigned int Oid
Definition: postgres_ext.h:31
List * lappend_oid(List *list, Oid datum)
Definition: list.c:358
CatCTup * members[FLEXIBLE_ARRAY_MEMBER]
Definition: catcache.h:178
#define ObjectIdGetDatum(X)
Definition: postgres.h:507
#define SearchSysCacheList1(cacheId, key1)
Definition: syscache.h:210
#define ReleaseSysCacheList(x)
Definition: syscache.h:217
FormData_pg_publication_rel * Form_pg_publication_rel
int i
HeapTupleData tuple
Definition: catcache.h:121
Definition: pg_list.h:50

◆ is_publishable_relation()

bool is_publishable_relation ( Relation  rel)

Definition at line 116 of file pg_publication.c.

References is_publishable_class(), RelationData::rd_rel, and RelationGetRelid.

Referenced by GetRelationPublicationActions(), pgoutput_change(), and pgoutput_truncate().

117 {
118  return is_publishable_class(RelationGetRelid(rel), rel->rd_rel);
119 }
Form_pg_class rd_rel
Definition: rel.h:83
static bool is_publishable_class(Oid relid, Form_pg_class reltuple)
#define RelationGetRelid(relation)
Definition: rel.h:423

◆ publication_add_relation()

ObjectAddress publication_add_relation ( Oid  pubid,
Relation  targetrel,
bool  if_not_exists 
)

Definition at line 149 of file pg_publication.c.

References CacheInvalidateRelcache(), CatalogTupleInsert(), check_publication_add_relation(), DEPENDENCY_AUTO, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, GetNewOidWithIndex(), GetPublication(), heap_form_tuple(), heap_freetuple(), InvalidObjectAddress, Publication::name, ObjectAddressSet, ObjectIdGetDatum, PUBLICATIONRELMAP, PublicationRelObjectIndexId, recordDependencyOn(), RelationGetDescr, RelationGetRelationName, RelationGetRelid, RowExclusiveLock, SearchSysCacheExists2, table_close(), table_open(), and values.

Referenced by PublicationAddTables().

151 {
152  Relation rel;
153  HeapTuple tup;
154  Datum values[Natts_pg_publication_rel];
155  bool nulls[Natts_pg_publication_rel];
156  Oid relid = RelationGetRelid(targetrel);
157  Oid prrelid;
158  Publication *pub = GetPublication(pubid);
159  ObjectAddress myself,
160  referenced;
161 
162  rel = table_open(PublicationRelRelationId, RowExclusiveLock);
163 
164  /*
165  * Check for duplicates. Note that this does not really prevent
166  * duplicates, it's here just to provide nicer error message in common
167  * case. The real protection is the unique key on the catalog.
168  */
170  ObjectIdGetDatum(pubid)))
171  {
173 
174  if (if_not_exists)
175  return InvalidObjectAddress;
176 
177  ereport(ERROR,
179  errmsg("relation \"%s\" is already member of publication \"%s\"",
180  RelationGetRelationName(targetrel), pub->name)));
181  }
182 
184 
185  /* Form a tuple. */
186  memset(values, 0, sizeof(values));
187  memset(nulls, false, sizeof(nulls));
188 
190  Anum_pg_publication_rel_oid);
191  values[Anum_pg_publication_rel_oid - 1] = ObjectIdGetDatum(prrelid);
192  values[Anum_pg_publication_rel_prpubid - 1] =
193  ObjectIdGetDatum(pubid);
194  values[Anum_pg_publication_rel_prrelid - 1] =
195  ObjectIdGetDatum(relid);
196 
197  tup = heap_form_tuple(RelationGetDescr(rel), values, nulls);
198 
199  /* Insert tuple into catalog. */
200  CatalogTupleInsert(rel, tup);
201  heap_freetuple(tup);
202 
203  ObjectAddressSet(myself, PublicationRelRelationId, prrelid);
204 
205  /* Add dependency on the publication */
206  ObjectAddressSet(referenced, PublicationRelationId, pubid);
207  recordDependencyOn(&myself, &referenced, DEPENDENCY_AUTO);
208 
209  /* Add dependency on the relation */
210  ObjectAddressSet(referenced, RelationRelationId, relid);
211  recordDependencyOn(&myself, &referenced, DEPENDENCY_AUTO);
212 
213  /* Close the table. */
215 
216  /* Invalidate relcache so that publication info is rebuilt. */
217  CacheInvalidateRelcache(targetrel);
218 
219  return myself;
220 }
Oid GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn)
Definition: catalog.c:322
void table_close(Relation relation, LOCKMODE lockmode)
Definition: table.c:133
#define RelationGetDescr(relation)
Definition: rel.h:449
int errcode(int sqlerrcode)
Definition: elog.c:608
void recordDependencyOn(const ObjectAddress *depender, const ObjectAddress *referenced, DependencyType behavior)
Definition: pg_depend.c:43
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, Datum *values, bool *isnull)
Definition: heaptuple.c:1020
void heap_freetuple(HeapTuple htup)
Definition: heaptuple.c:1338
unsigned int Oid
Definition: postgres_ext.h:31
Publication * GetPublication(Oid pubid)
#define ObjectIdGetDatum(X)
Definition: postgres.h:507
#define ERROR
Definition: elog.h:43
static void check_publication_add_relation(Relation targetrel)
#define RowExclusiveLock
Definition: lockdefs.h:38
#define RelationGetRelationName(relation)
Definition: rel.h:457
#define ereport(elevel, rest)
Definition: elog.h:141
uintptr_t Datum
Definition: postgres.h:367
#define SearchSysCacheExists2(cacheId, key1, key2)
Definition: syscache.h:185
#define ObjectAddressSet(addr, class_id, object_id)
Definition: objectaddress.h:40
#define PublicationRelObjectIndexId
Definition: indexing.h:355
void CacheInvalidateRelcache(Relation relation)
Definition: inval.c:1270
static Datum values[MAXATTR]
Definition: bootstrap.c:167
const ObjectAddress InvalidObjectAddress
int errmsg(const char *fmt,...)
Definition: elog.c:822
Relation table_open(Oid relationId, LOCKMODE lockmode)
Definition: table.c:39
#define ERRCODE_DUPLICATE_OBJECT
Definition: streamutil.c:31
#define RelationGetRelid(relation)
Definition: rel.h:423
void CatalogTupleInsert(Relation heapRel, HeapTuple tup)
Definition: indexing.c:183

Variable Documentation

◆ FormData_pg_publication

FormData_pg_publication

Definition at line 56 of file pg_publication.h.