---
# System prepended metadata

title: 'Changes made in PG13:'

---

# Changes made in PG13: 

few importent functions have been changed in PG13 compare to PG12 and PG11. One of the importence note is `RangeTblEntry` that has been changed to `ParsedNamesplaceItem` as following 

```c
struct ParseNamespaceItem
{
	RangeTblEntry *p_rte;	/* The relation's rangetable entry */
	int		p_rtindex;		/* The relation's index in the rangetable */
	/* array of same length as p_rte->eref->colnames: */
	ParseNamespaceColumn *p_nscolumns;	/* per-column data */
	bool		p_rel_visible;	/* Relation name is visible? */
	bool		p_cols_visible; /* Column names visible as unqualified refs? */
	bool		p_lateral_only; /* Is only visible to LATERAL expressions? */
	bool		p_lateral_ok;	/* If so, does join type allow use? */
};
```

This change has also affected the other structures. One of them is `ParseNamespaceColumn` that has been introduced in PG13 as well and has been extensivly used. Following is it's defination. 

```c
struct ParseNamespaceColumn
{
	Index		p_varno;	/* rangetable index */
	AttrNumber	p_varattno;	/* attribute number of the column */
	Oid		p_vartype;	/* pg_type OID */
	int32		p_vartypmod;	/* type modifier value */
	Oid	        p_varcollid;	/* OID of collation, or InvalidOid */
	Index		p_varnosyn;	/* rangetable index of syntactic referent */
	AttrNumber	p_varattnosyn;	/* attribute number of syntactic referent */
};
```

This parse namespace item already exists in PG11 and we may think replace the existing functions as well. In the `cypter_items.c` and in function `ExpandAllTables` 
```c
ParseNamespaceItem *nsitem = (ParseNamespaceItem *) lfirst(l);
```

Another change is 
```c
RTERangeTablePosn(pstate, rte, NULL);
````
```c
rtindex = nsitem->p_rtindex;
```

Similarly `scanRTEForColumn` becomes `scanNSItemForColumn`.