← Back to Overview

src/backend/commands/propgraphcmds.c

Coverage: 804/850 lines (94.6%)
Total Lines
850
modified
Covered
804
94.6%
Uncovered
46
5.4%
키보드 네비게이션
CreatePropGraph() lines 104-317
Modified Lines Coverage: 109/117 lines (93.2%)
LineHitsSourceCommit
104 138 CreatePropGraph(ParseState *pstate, const CreatePropGraphStmt *stmt) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
105 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
106 138 CreateStmt *cstmt = makeNode(CreateStmt); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
107 138 char components_persistence; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
108 138 ListCell *lc; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
109 138 ObjectAddress pgaddress; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
110 138 List *vertex_infos = NIL; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
111 138 List *edge_infos = NIL; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
112 138 List *element_aliases = NIL; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
113 138 List *element_oids = NIL; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
114 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
115 138 if (stmt->pgname->relpersistence == RELPERSISTENCE_UNLOGGED) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
116 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
117 - (errcode(ERRCODE_SYNTAX_ERROR), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
118 - errmsg("property graphs cannot be unlogged because they do not have storage"))); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
119 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
120 138 components_persistence = RELPERSISTENCE_PERMANENT; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
121 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
122 385 foreach(lc, stmt->vertex_tables) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
123 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
124 253 PropGraphVertex *vertex = lfirst_node(PropGraphVertex, lc); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
125 253 struct element_info *vinfo; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
126 253 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
127 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
128 253 vinfo = palloc0_object(struct element_info); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
129 253 vinfo->kind = PGEKIND_VERTEX; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
130 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
131 253 vinfo->relid = RangeVarGetRelidExtended(vertex->vtable, AccessShareLock, 0, RangeVarCallbackOwnsRelation, NULL); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
132 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
133 250 rel = table_open(vinfo->relid, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
134 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
135 250 if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
136 0 components_persistence = RELPERSISTENCE_TEMP; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
137 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
138 250 if (vertex->vtable->alias) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
139 6 vinfo->aliasname = vertex->vtable->alias->aliasname; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
140 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
141 244 vinfo->aliasname = vertex->vtable->relname; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
142 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
143 250 if (list_member(element_aliases, makeString(vinfo->aliasname))) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
144 3 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
145 - (errcode(ERRCODE_DUPLICATE_TABLE), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
146 - errmsg("alias \"%s\" used more than once as element table", vinfo->aliasname), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
147 - parser_errposition(pstate, vertex->location))); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
148 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
149 247 vinfo->key = propgraph_element_get_key(pstate, vertex->vkey, rel, vinfo->aliasname, vertex->location); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
150 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
151 247 vinfo->labels = vertex->labels; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
152 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
153 247 table_close(rel, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
154 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
155 247 vertex_infos = lappend(vertex_infos, vinfo); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
156 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
157 247 element_aliases = lappend(element_aliases, makeString(vinfo->aliasname)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
158 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
159 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
160 246 foreach(lc, stmt->edge_tables) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
161 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
162 129 PropGraphEdge *edge = lfirst_node(PropGraphEdge, lc); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
163 129 struct element_info *einfo; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
164 129 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
165 129 ListCell *lc2; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
166 129 Oid srcrelid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
167 129 Oid destrelid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
168 129 Relation srcrel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
169 129 Relation destrel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
170 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
171 129 einfo = palloc0_object(struct element_info); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
172 129 einfo->kind = PGEKIND_EDGE; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
173 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
174 129 einfo->relid = RangeVarGetRelidExtended(edge->etable, AccessShareLock, 0, RangeVarCallbackOwnsRelation, NULL); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
175 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
176 129 rel = table_open(einfo->relid, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
177 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
178 129 if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
179 0 components_persistence = RELPERSISTENCE_TEMP; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
180 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
181 129 if (edge->etable->alias) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
182 0 einfo->aliasname = edge->etable->alias->aliasname; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
183 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
184 129 einfo->aliasname = edge->etable->relname; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
185 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
186 129 if (list_member(element_aliases, makeString(einfo->aliasname))) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
187 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
188 - (errcode(ERRCODE_DUPLICATE_TABLE), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
189 - errmsg("alias \"%s\" used more than once as element table", einfo->aliasname), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
190 - parser_errposition(pstate, edge->location))); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
191 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
192 129 einfo->key = propgraph_element_get_key(pstate, edge->ekey, rel, einfo->aliasname, edge->location); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
193 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
194 129 einfo->srcvertex = edge->esrcvertex; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
195 129 einfo->destvertex = edge->edestvertex; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
196 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
197 129 srcrelid = 0; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
198 129 destrelid = 0; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
199 316 foreach(lc2, vertex_infos) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
200 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
201 310 struct element_info *vinfo = lfirst(lc2); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
202 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
203 310 if (strcmp(vinfo->aliasname, edge->esrcvertex) == 0) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
204 126 srcrelid = vinfo->relid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
205 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
206 310 if (strcmp(vinfo->aliasname, edge->edestvertex) == 0) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
207 126 destrelid = vinfo->relid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
208 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
209 310 if (srcrelid && destrelid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
210 - break; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
211 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
212 129 if (!srcrelid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
213 3 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
214 - (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
215 - errmsg("source vertex \"%s\" of edge \"%s\" does not exist", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
216 - edge->esrcvertex, einfo->aliasname), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
217 - parser_errposition(pstate, edge->location))); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
218 126 if (!destrelid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
219 3 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
220 - (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
221 - errmsg("destination vertex \"%s\" of edge \"%s\" does not exist", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
222 - edge->edestvertex, einfo->aliasname), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
223 - parser_errposition(pstate, edge->location))); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
224 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
225 123 srcrel = table_open(srcrelid, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
226 123 destrel = table_open(destrelid, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
227 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
228 123 propgraph_edge_get_ref_keys(pstate, edge->esrckey, edge->esrcvertexcols, rel, srcrel, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
229 123 einfo->aliasname, edge->location, "SOURCE", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
230 - &einfo->srckey, &einfo->srcref, &einfo->srceqop); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
231 117 propgraph_edge_get_ref_keys(pstate, edge->edestkey, edge->edestvertexcols, rel, destrel, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
232 117 einfo->aliasname, edge->location, "DESTINATION", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
233 - &einfo->destkey, &einfo->destref, &einfo->desteqop); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
234 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
235 114 einfo->labels = edge->labels; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
236 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
237 114 table_close(destrel, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
238 114 table_close(srcrel, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
239 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
240 114 table_close(rel, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
241 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
242 114 edge_infos = lappend(edge_infos, einfo); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
243 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
244 114 element_aliases = lappend(element_aliases, makeString(einfo->aliasname)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
245 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
246 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
247 117 cstmt->relation = stmt->pgname; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
248 117 cstmt->oncommit = ONCOMMIT_NOOP; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
249 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
250 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
251 - * Automatically make it temporary if any component tables are temporary 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
252 - * (see also DefineView()). 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
253 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
254 117 if (stmt->pgname->relpersistence == RELPERSISTENCE_PERMANENT 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
255 117 && components_persistence == RELPERSISTENCE_TEMP) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
256 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
257 0 cstmt->relation = copyObject(cstmt->relation); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
258 0 cstmt->relation->relpersistence = RELPERSISTENCE_TEMP; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
259 0 ereport(NOTICE, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
260 - (errmsg("property graph \"%s\" will be temporary", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
261 - stmt->pgname->relname))); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
262 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
263 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
264 117 pgaddress = DefineRelation(cstmt, RELKIND_PROPGRAPH, InvalidOid, NULL, NULL); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
265 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
266 313 foreach(lc, vertex_infos) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
267 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
268 211 struct element_info *vinfo = lfirst(lc); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
269 211 Oid peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
270 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
271 211 peoid = insert_element_record(pgaddress, vinfo); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
272 199 element_oids = lappend_oid(element_oids, peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
273 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
274 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
275 213 foreach(lc, edge_infos) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
276 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
277 114 struct element_info *einfo = lfirst(lc); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
278 114 Oid peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
279 114 ListCell *lc2; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
280 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
281 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
282 - * Look up the vertices again. Now the vertices have OIDs assigned, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
283 - * which we need. 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
284 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
285 280 foreach(lc2, vertex_infos) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
286 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
287 280 struct element_info *vinfo = lfirst(lc2); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
288 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
289 280 if (strcmp(vinfo->aliasname, einfo->srcvertex) == 0) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
290 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
291 114 einfo->srcvertexid = vinfo->elementid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
292 114 einfo->srcrelid = vinfo->relid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
293 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
294 280 if (strcmp(vinfo->aliasname, einfo->destvertex) == 0) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
295 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
296 114 einfo->destvertexid = vinfo->elementid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
297 114 einfo->destrelid = vinfo->relid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
298 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
299 280 if (einfo->srcvertexid && einfo->destvertexid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
300 - break; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
301 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
302 114 Assert(einfo->srcvertexid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
303 114 Assert(einfo->destvertexid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
304 114 Assert(einfo->srcrelid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
305 114 Assert(einfo->destrelid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
306 114 peoid = insert_element_record(pgaddress, einfo); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
307 111 element_oids = lappend_oid(element_oids, peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
308 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
309 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
310 99 CommandCounterIncrement(); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
311 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
312 382 foreach_oid(peoid, element_oids) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
313 286 check_element_properties(peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
314 96 check_all_labels_properties(pgaddress.objectId); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
315 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
316 87 return pgaddress; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
317 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
propgraph_element_get_key() lines 325-354
Modified Lines Coverage: 12/13 lines (92.3%)
LineHitsSourceCommit
325 421 propgraph_element_get_key(ParseState *pstate, const List *key_clause, Relation element_rel, const char *aliasname, int location) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
326 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
327 421 ArrayType *a; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
328 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
329 421 if (key_clause == NIL) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
330 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
331 84 Oid pkidx = RelationGetPrimaryKeyIndex(element_rel, false); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
332 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
333 84 if (!pkidx) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
334 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
335 - errcode(ERRCODE_INVALID_OBJECT_DEFINITION), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
336 - errmsg("no key specified and no suitable primary key exists for definition of element \"%s\"", aliasname), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
337 - parser_errposition(pstate, location)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
338 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
339 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
340 84 Relation indexDesc; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
341 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
342 84 indexDesc = index_open(pkidx, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
343 84 a = array_from_attnums(indexDesc->rd_index->indkey.dim1, indexDesc->rd_index->indkey.values); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
344 84 index_close(indexDesc, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
345 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
346 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
347 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
348 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
349 337 a = array_from_attnums(list_length(key_clause), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
350 337 array_from_column_list(pstate, key_clause, location, element_rel)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
351 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
352 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
353 421 return a; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
354 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
propgraph_edge_get_ref_keys() lines 371-512
Modified Lines Coverage: 57/63 lines (90.5%)
LineHitsSourceCommit
371 294 propgraph_edge_get_ref_keys(ParseState *pstate, const List *keycols, const List *refcols, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
372 - Relation edge_rel, Relation ref_rel, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
373 - const char *aliasname, int location, const char *type, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
374 - ArrayType **outkey, ArrayType **outref, ArrayType **outeqop) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
375 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
376 294 int nkeys; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
377 294 AttrNumber *keyattnums; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
378 294 AttrNumber *refattnums; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
379 294 Oid *keyeqops; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
380 294 Datum *datums; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
381 294 int i; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
382 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
383 294 Assert((keycols && refcols) || (!keycols && !refcols)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
384 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
385 294 if (keycols) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
386 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
387 570 if (list_length(keycols) != list_length(refcols)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
388 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
389 - errcode(ERRCODE_INVALID_OBJECT_DEFINITION), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
390 - errmsg("mismatching number of columns in %s vertex definition of edge \"%s\"", type, aliasname), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
391 - parser_errposition(pstate, location)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
392 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
393 285 nkeys = list_length(keycols); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
394 285 keyattnums = array_from_column_list(pstate, keycols, location, edge_rel); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
395 285 refattnums = array_from_column_list(pstate, refcols, location, ref_rel); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
396 285 keyeqops = palloc_array(Oid, nkeys); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
397 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
398 887 for (i = 0; i < nkeys; i++) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
399 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
400 323 Oid keytype; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
401 323 int32 keytypmod; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
402 323 Oid keycoll; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
403 323 Oid reftype; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
404 323 int32 reftypmod; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
405 323 Oid refcoll; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
406 323 Oid opc; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
407 323 Oid opf; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
408 323 StrategyNumber strategy; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
409 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
410 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
411 - * Lookup equality operator to be used for edge and vertex key. 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
412 - * Vertex key is equivalent to primary key and edge key is similar 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
413 - * to foreign key since edge key references vertex key. Hence 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
414 - * vertex key is used as left operand and edge key is used as 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
415 - * right operand. The method used to find the equality operators 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
416 - * is similar to the method used to find equality operators for 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
417 - * FK/PK comparison in ATAddForeignKeyConstraint() except that 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
418 - * opclass of the the vertex key type is used as a starting point. 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
419 - * Since we need only equality operators we use both BT and HASH 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
420 - * strategies. 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
421 - * 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
422 - * If the required operators do not exist, we can not construct 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
423 - * quals linking an edge to its adjacent vertexes. 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
424 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
425 323 get_atttypetypmodcoll(RelationGetRelid(edge_rel), keyattnums[i], &keytype, &keytypmod, &keycoll); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
426 323 get_atttypetypmodcoll(RelationGetRelid(ref_rel), refattnums[i], &reftype, &reftypmod, &refcoll); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
427 323 keyeqops[i] = InvalidOid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
428 323 strategy = BTEqualStrategyNumber; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
429 323 opc = GetDefaultOpClass(reftype, BTREE_AM_OID); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
430 323 if (!OidIsValid(opc)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
431 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
432 0 opc = GetDefaultOpClass(reftype, HASH_AM_OID); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
433 0 strategy = HTEqualStrategyNumber; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
434 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
435 0 if (OidIsValid(opc)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
436 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
437 323 opf = get_opclass_family(opc); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
438 323 if (OidIsValid(opf)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
439 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
440 323 keyeqops[i] = get_opfamily_member(opf, reftype, keytype, strategy); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
441 323 if (!OidIsValid(keyeqops[i])) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
442 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
443 - /* Last resort, implicit cast. */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
444 3 if (can_coerce_type(1, &keytype, &reftype, COERCION_IMPLICIT)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
445 0 keyeqops[i] = get_opfamily_member(opf, reftype, reftype, strategy); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
446 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
447 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
448 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
449 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
450 323 if (!OidIsValid(keyeqops[i])) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
451 3 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
452 - errcode(ERRCODE_SYNTAX_ERROR), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
453 - errmsg("no equality operator exists for %s key comparison of edge \"%s\"", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
454 - type, aliasname), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
455 - parser_errposition(pstate, location)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
456 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
457 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
458 - * If collations of key attribute and referenced attribute are 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
459 - * different, an edge may end up being adjacent to undesired 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
460 - * vertexes. Prohibit such a case. 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
461 - * 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
462 - * PK/FK allows different collations as long as they are 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
463 - * deterministic for backward compatibility. But we can be a bit 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
464 - * stricter here and follow SQL standard. 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
465 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
466 320 if (keycoll != refcoll && 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
467 3 keycoll != DEFAULT_COLLATION_OID && refcoll != DEFAULT_COLLATION_OID && 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
468 3 OidIsValid(keycoll) && OidIsValid(refcoll)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
469 320 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
470 - errcode(ERRCODE_SYNTAX_ERROR), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
471 - errmsg("collation mismatch in %s key of edge \"%s\": %s vs. %s", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
472 - type, aliasname, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
473 - get_collation_name(keycoll), get_collation_name(refcoll)), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
474 - parser_errposition(pstate, location)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
475 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
476 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
477 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
478 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
479 - ForeignKeyCacheInfo *fk = NULL; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
480 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
481 21 foreach_node(ForeignKeyCacheInfo, tmp, RelationGetFKeyList(edge_rel)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
482 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
483 12 if (tmp->confrelid == RelationGetRelid(ref_rel)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
484 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
485 6 if (fk) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
486 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
487 - errcode(ERRCODE_SYNTAX_ERROR), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
488 - errmsg("more than one suitable foreign key exists for %s key of edge \"%s\"", type, aliasname), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
489 - parser_errposition(pstate, location)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
490 - fk = tmp; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
491 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
492 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
493 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
494 9 if (!fk) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
495 3 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
496 - errcode(ERRCODE_SYNTAX_ERROR), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
497 - errmsg("no %s key specified and no suitable foreign key exists for definition of edge \"%s\"", type, aliasname), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
498 - parser_errposition(pstate, location)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
499 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
500 6 nkeys = fk->nkeys; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
501 6 keyattnums = fk->conkey; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
502 6 refattnums = fk->confkey; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
503 6 keyeqops = fk->conpfeqop; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
504 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
505 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
506 285 *outkey = array_from_attnums(nkeys, keyattnums); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
507 285 *outref = array_from_attnums(nkeys, refattnums); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
508 285 datums = (Datum *) palloc(sizeof(Datum) * nkeys); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
509 893 for (i = 0; i < nkeys; i++) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
510 323 datums[i] = ObjectIdGetDatum(keyeqops[i]); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
511 285 *outeqop = construct_array_builtin(datums, nkeys, OIDOID); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
512 285 } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
array_from_column_list() lines 519-559
Modified Lines Coverage: 20/21 lines (95.2%)
LineHitsSourceCommit
519 907 array_from_column_list(ParseState *pstate, const List *colnames, int location, Relation element_rel) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
520 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
521 907 int numattrs; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
522 907 AttrNumber *attnums; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
523 907 int i; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
524 907 ListCell *lc; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
525 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
526 907 numattrs = list_length(colnames); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
527 907 attnums = palloc_array(AttrNumber, numattrs); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
528 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
529 907 i = 0; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
530 2011 foreach(lc, colnames) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
531 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
532 1104 char *colname = strVal(lfirst(lc)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
533 1104 Oid relid = RelationGetRelid(element_rel); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
534 1104 AttrNumber attnum; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
535 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
536 1104 attnum = get_attnum(relid, colname); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
537 1104 if (!attnum) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
538 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
539 - (errcode(ERRCODE_UNDEFINED_COLUMN), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
540 - errmsg("column \"%s\" of relation \"%s\" does not exist", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
541 - colname, get_rel_name(relid)), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
542 - parser_errposition(pstate, location))); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
543 1104 attnums[i++] = attnum; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
544 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
545 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
546 2011 for (int j = 0; j < numattrs; j++) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
547 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
548 1328 for (int k = j + 1; k < numattrs; k++) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
549 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
550 224 if (attnums[j] == attnums[k]) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
551 224 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
552 - (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
553 - errmsg("graph key columns list must not contain duplicates"), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
554 - parser_errposition(pstate, location))); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
555 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
556 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
557 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
558 907 return attnums; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
559 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
array_from_attnums() lines 562-572
Modified Lines Coverage: 6/6 lines (100.0%)
LineHitsSourceCommit
562 991 array_from_attnums(int numattrs, const AttrNumber *attnums) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
563 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
564 991 Datum *attnumsd; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
565 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
566 991 attnumsd = palloc_array(Datum, numattrs); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
567 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
568 2203 for (int i = 0; i < numattrs; i++) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
569 1212 attnumsd[i] = Int16GetDatum(attnums[i]); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
570 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
571 991 return construct_array_builtin(attnumsd, numattrs, INT2OID); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
572 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
array_of_attnums_to_objectaddrs() lines 575-589
Modified Lines Coverage: 9/9 lines (100.0%)
LineHitsSourceCommit
575 934 array_of_attnums_to_objectaddrs(Oid relid, ArrayType *arr, ObjectAddresses *addrs) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
576 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
577 934 Datum *attnumsd; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
578 934 int numattrs; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
579 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
580 934 deconstruct_array_builtin(arr, INT2OID, &attnumsd, NULL, &numattrs); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
581 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
582 2074 for (int i = 0; i < numattrs; i++) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
583 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
584 1140 ObjectAddress referenced; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
585 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
586 1140 ObjectAddressSubSet(referenced, RelationRelationId, relid, DatumGetInt16(attnumsd[i])); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
587 1140 add_exact_object_address(&referenced, addrs); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
588 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
589 934 } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
array_of_opers_to_objectaddrs() lines 592-606
Modified Lines Coverage: 9/9 lines (100.0%)
LineHitsSourceCommit
592 282 array_of_opers_to_objectaddrs(ArrayType *arr, ObjectAddresses *addrs) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
593 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
594 282 Datum *opersd; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
595 282 int numopers; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
596 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
597 282 deconstruct_array_builtin(arr, OIDOID, &opersd, NULL, &numopers); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
598 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
599 602 for (int i = 0; i < numopers; i++) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
600 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
601 320 ObjectAddress referenced; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
602 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
603 320 ObjectAddressSet(referenced, OperatorRelationId, DatumGetObjectId(opersd[i])); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
604 320 add_exact_object_address(&referenced, addrs); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
605 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
606 282 } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
insert_element_record() lines 613-737
Modified Lines Coverage: 75/81 lines (92.6%)
LineHitsSourceCommit
613 370 insert_element_record(ObjectAddress pgaddress, struct element_info *einfo) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
614 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
615 370 Oid graphid = pgaddress.objectId; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
616 370 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
617 370 NameData aliasname; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
618 370 Oid peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
619 370 Datum values[Natts_pg_propgraph_element] = {0}; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
620 370 bool nulls[Natts_pg_propgraph_element] = {0}; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
621 370 HeapTuple tup; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
622 370 ObjectAddress myself; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
623 370 ObjectAddress referenced; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
624 370 ObjectAddresses *addrs; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
625 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
626 370 rel = table_open(PropgraphElementRelationId, RowExclusiveLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
627 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
628 370 peoid = GetNewOidWithIndex(rel, PropgraphElementObjectIndexId, Anum_pg_propgraph_element_oid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
629 370 einfo->elementid = peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
630 370 values[Anum_pg_propgraph_element_oid - 1] = ObjectIdGetDatum(peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
631 370 values[Anum_pg_propgraph_element_pgepgid - 1] = ObjectIdGetDatum(graphid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
632 370 values[Anum_pg_propgraph_element_pgerelid - 1] = ObjectIdGetDatum(einfo->relid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
633 370 namestrcpy(&aliasname, einfo->aliasname); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
634 370 values[Anum_pg_propgraph_element_pgealias - 1] = NameGetDatum(&aliasname); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
635 370 values[Anum_pg_propgraph_element_pgekind - 1] = CharGetDatum(einfo->kind); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
636 370 values[Anum_pg_propgraph_element_pgesrcvertexid - 1] = ObjectIdGetDatum(einfo->srcvertexid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
637 370 values[Anum_pg_propgraph_element_pgedestvertexid - 1] = ObjectIdGetDatum(einfo->destvertexid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
638 370 values[Anum_pg_propgraph_element_pgekey - 1] = PointerGetDatum(einfo->key); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
639 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
640 370 if (einfo->srckey) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
641 141 values[Anum_pg_propgraph_element_pgesrckey - 1] = PointerGetDatum(einfo->srckey); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
642 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
643 229 nulls[Anum_pg_propgraph_element_pgesrckey - 1] = true; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
644 370 if (einfo->srcref) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
645 141 values[Anum_pg_propgraph_element_pgesrcref - 1] = PointerGetDatum(einfo->srcref); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
646 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
647 229 nulls[Anum_pg_propgraph_element_pgesrcref - 1] = true; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
648 370 if (einfo->srceqop) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
649 141 values[Anum_pg_propgraph_element_pgesrceqop - 1] = PointerGetDatum(einfo->srceqop); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
650 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
651 229 nulls[Anum_pg_propgraph_element_pgesrceqop - 1] = true; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
652 370 if (einfo->destkey) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
653 141 values[Anum_pg_propgraph_element_pgedestkey - 1] = PointerGetDatum(einfo->destkey); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
654 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
655 229 nulls[Anum_pg_propgraph_element_pgedestkey - 1] = true; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
656 370 if (einfo->destref) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
657 141 values[Anum_pg_propgraph_element_pgedestref - 1] = PointerGetDatum(einfo->destref); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
658 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
659 229 nulls[Anum_pg_propgraph_element_pgedestref - 1] = true; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
660 370 if (einfo->desteqop) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
661 141 values[Anum_pg_propgraph_element_pgedesteqop - 1] = PointerGetDatum(einfo->desteqop); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
662 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
663 229 nulls[Anum_pg_propgraph_element_pgedesteqop - 1] = true; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
664 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
665 370 tup = heap_form_tuple(RelationGetDescr(rel), values, nulls); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
666 370 CatalogTupleInsert(rel, tup); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
667 370 heap_freetuple(tup); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
668 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
669 370 ObjectAddressSet(myself, PropgraphElementRelationId, peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
670 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
671 - /* Add dependency on the property graph */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
672 370 recordDependencyOn(&myself, &pgaddress, DEPENDENCY_AUTO); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
673 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
674 370 addrs = new_object_addresses(); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
675 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
676 - /* Add dependency on the relation */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
677 370 ObjectAddressSet(referenced, RelationRelationId, einfo->relid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
678 370 add_exact_object_address(&referenced, addrs); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
679 370 array_of_attnums_to_objectaddrs(einfo->relid, einfo->key, addrs); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
680 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
681 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
682 - * Add dependencies on vertices and equality operators used for key 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
683 - * comparison. 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
684 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
685 370 if (einfo->srcvertexid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
686 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
687 141 ObjectAddressSet(referenced, PropgraphElementRelationId, einfo->srcvertexid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
688 141 add_exact_object_address(&referenced, addrs); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
689 141 array_of_attnums_to_objectaddrs(einfo->relid, einfo->srckey, addrs); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
690 141 array_of_attnums_to_objectaddrs(einfo->srcrelid, einfo->srcref, addrs); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
691 141 array_of_opers_to_objectaddrs(einfo->srceqop, addrs); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
692 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
693 370 if (einfo->destvertexid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
694 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
695 141 ObjectAddressSet(referenced, PropgraphElementRelationId, einfo->destvertexid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
696 141 add_exact_object_address(&referenced, addrs); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
697 141 array_of_attnums_to_objectaddrs(einfo->relid, einfo->destkey, addrs); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
698 141 array_of_attnums_to_objectaddrs(einfo->destrelid, einfo->destref, addrs); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
699 141 array_of_opers_to_objectaddrs(einfo->desteqop, addrs); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
700 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
701 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
702 370 record_object_address_dependencies(&myself, addrs, DEPENDENCY_NORMAL); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
703 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
704 370 table_close(rel, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
705 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
706 370 if (einfo->labels) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
707 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
708 370 ListCell *lc; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
709 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
710 811 foreach(lc, einfo->labels) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
711 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
712 462 PropGraphLabelAndProperties *lp = lfirst_node(PropGraphLabelAndProperties, lc); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
713 462 Oid ellabeloid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
714 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
715 462 if (lp->label) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
716 202 ellabeloid = insert_label_record(graphid, peoid, lp->label); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
717 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
718 260 ellabeloid = insert_label_record(graphid, peoid, einfo->aliasname); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
719 462 insert_property_records(graphid, ellabeloid, einfo->relid, lp->properties); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
720 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
721 441 CommandCounterIncrement(); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
722 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
723 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
724 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
725 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
726 0 Oid ellabeloid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
727 0 PropGraphProperties *pr = makeNode(PropGraphProperties); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
728 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
729 0 pr->all = true; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
730 0 pr->location = -1; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
731 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
732 0 ellabeloid = insert_label_record(graphid, peoid, einfo->aliasname); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
733 0 insert_property_records(graphid, ellabeloid, einfo->relid, pr); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
734 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
735 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
736 349 return peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
737 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
insert_label_record() lines 746-818
Modified Lines Coverage: 46/46 lines (100.0%)
LineHitsSourceCommit
746 483 insert_label_record(Oid graphid, Oid peoid, const char *label) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
747 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
748 483 Oid labeloid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
749 483 Oid ellabeloid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
750 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
751 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
752 - * Insert into pg_propgraph_label if not already existing. 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
753 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
754 483 labeloid = GetSysCacheOid2(PROPGRAPHLABELNAME, Anum_pg_propgraph_label_oid, ObjectIdGetDatum(graphid), CStringGetDatum(label)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
755 483 if (!labeloid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
756 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
757 366 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
758 366 Datum values[Natts_pg_propgraph_label] = {0}; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
759 366 bool nulls[Natts_pg_propgraph_label] = {0}; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
760 366 NameData labelname; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
761 366 HeapTuple tup; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
762 366 ObjectAddress myself; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
763 366 ObjectAddress referenced; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
764 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
765 366 rel = table_open(PropgraphLabelRelationId, RowExclusiveLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
766 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
767 366 labeloid = GetNewOidWithIndex(rel, PropgraphLabelObjectIndexId, Anum_pg_propgraph_label_oid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
768 366 values[Anum_pg_propgraph_label_oid - 1] = ObjectIdGetDatum(labeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
769 366 values[Anum_pg_propgraph_label_pglpgid - 1] = ObjectIdGetDatum(graphid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
770 366 namestrcpy(&labelname, label); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
771 366 values[Anum_pg_propgraph_label_pgllabel - 1] = NameGetDatum(&labelname); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
772 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
773 366 tup = heap_form_tuple(RelationGetDescr(rel), values, nulls); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
774 366 CatalogTupleInsert(rel, tup); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
775 366 heap_freetuple(tup); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
776 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
777 366 ObjectAddressSet(myself, PropgraphLabelRelationId, labeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
778 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
779 366 ObjectAddressSet(referenced, RelationRelationId, graphid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
780 366 recordDependencyOn(&myself, &referenced, DEPENDENCY_AUTO); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
781 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
782 366 table_close(rel, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
783 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
784 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
785 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
786 - * Insert into pg_propgraph_element_label 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
787 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
788 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
789 483 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
790 483 Datum values[Natts_pg_propgraph_element_label] = {0}; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
791 483 bool nulls[Natts_pg_propgraph_element_label] = {0}; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
792 483 HeapTuple tup; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
793 483 ObjectAddress myself; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
794 483 ObjectAddress referenced; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
795 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
796 483 rel = table_open(PropgraphElementLabelRelationId, RowExclusiveLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
797 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
798 483 ellabeloid = GetNewOidWithIndex(rel, PropgraphElementLabelObjectIndexId, Anum_pg_propgraph_element_label_oid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
799 483 values[Anum_pg_propgraph_element_label_oid - 1] = ObjectIdGetDatum(ellabeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
800 483 values[Anum_pg_propgraph_element_label_pgellabelid - 1] = ObjectIdGetDatum(labeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
801 483 values[Anum_pg_propgraph_element_label_pgelelid - 1] = ObjectIdGetDatum(peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
802 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
803 483 tup = heap_form_tuple(RelationGetDescr(rel), values, nulls); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
804 483 CatalogTupleInsert(rel, tup); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
805 483 heap_freetuple(tup); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
806 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
807 483 ObjectAddressSet(myself, PropgraphElementLabelRelationId, ellabeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
808 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
809 483 ObjectAddressSet(referenced, PropgraphLabelRelationId, labeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
810 483 recordDependencyOn(&myself, &referenced, DEPENDENCY_AUTO); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
811 483 ObjectAddressSet(referenced, PropgraphElementRelationId, peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
812 483 recordDependencyOn(&myself, &referenced, DEPENDENCY_AUTO); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
813 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
814 483 table_close(rel, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
815 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
816 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
817 483 return ellabeloid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
818 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
insert_property_records() lines 824-909
Modified Lines Coverage: 47/47 lines (100.0%)
LineHitsSourceCommit
824 489 insert_property_records(Oid graphid, Oid ellabeloid, Oid pgerelid, const PropGraphProperties *properties) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
825 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
826 489 List *proplist = NIL; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
827 489 ParseState *pstate; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
828 489 ParseNamespaceItem *nsitem; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
829 489 List *tp; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
830 489 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
831 489 ListCell *lc; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
832 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
833 489 if (properties->all) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
834 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
835 187 Relation attRelation; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
836 187 SysScanDesc scan; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
837 187 ScanKeyData key[1]; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
838 187 HeapTuple attributeTuple; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
839 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
840 187 attRelation = table_open(AttributeRelationId, RowShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
841 187 ScanKeyInit(&key[0], 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
842 - Anum_pg_attribute_attrelid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
843 - BTEqualStrategyNumber, F_OIDEQ, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
844 - ObjectIdGetDatum(pgerelid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
845 187 scan = systable_beginscan(attRelation, AttributeRelidNumIndexId, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
846 - true, NULL, 1, key); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
847 1801 while (HeapTupleIsValid(attributeTuple = systable_getnext(scan))) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
848 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
849 1614 Form_pg_attribute att = (Form_pg_attribute) GETSTRUCT(attributeTuple); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
850 1614 ColumnRef *cr; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
851 1614 ResTarget *rt; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
852 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
853 1614 if (att->attnum <= 0 || att->attisdropped) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
854 1107 continue; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
855 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
856 507 cr = makeNode(ColumnRef); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
857 507 rt = makeNode(ResTarget); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
858 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
859 507 cr->fields = list_make1(makeString(pstrdup(NameStr(att->attname)))); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
860 507 cr->location = -1; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
861 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
862 507 rt->name = pstrdup(NameStr(att->attname)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
863 507 rt->val = (Node *) cr; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
864 507 rt->location = -1; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
865 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
866 507 proplist = lappend(proplist, rt); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
867 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
868 187 systable_endscan(scan); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
869 187 table_close(attRelation, RowShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
870 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
871 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
872 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
873 302 proplist = properties->properties; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
874 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
875 820 foreach(lc, proplist) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
876 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
877 518 ResTarget *rt = lfirst_node(ResTarget, lc); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
878 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
879 518 if (!rt->name && !IsA(rt->val, ColumnRef)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
880 518 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
881 - errcode(ERRCODE_SYNTAX_ERROR), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
882 - errmsg("property name required"), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
883 - parser_errposition(NULL, rt->location)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
884 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
885 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
886 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
887 489 rel = table_open(pgerelid, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
888 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
889 489 pstate = make_parsestate(NULL); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
890 489 nsitem = addRangeTableEntryForRelation(pstate, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
891 - rel, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
892 - AccessShareLock, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
893 - NULL, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
894 - false, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
895 - true); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
896 489 addNSItemToQuery(pstate, nsitem, true, true, true); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
897 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
898 489 table_close(rel, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
899 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
900 489 tp = transformTargetList(pstate, proplist, EXPR_KIND_PROPGRAPH_PROPERTY); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
901 489 assign_expr_collations(pstate, (Node *) tp); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
902 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
903 1490 foreach(lc, tp) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
904 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
905 1025 TargetEntry *te = lfirst_node(TargetEntry, lc); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
906 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
907 1025 insert_property_record(graphid, ellabeloid, pgerelid, te->resname, te->expr); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
908 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
909 465 } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
insert_property_record() lines 916-1033
Modified Lines Coverage: 66/66 lines (100.0%)
LineHitsSourceCommit
916 1025 insert_property_record(Oid graphid, Oid ellabeloid, Oid pgerelid, const char *propname, const Expr *expr) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
917 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
918 1025 Oid propoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
919 1025 Oid exprtypid = exprType((const Node *) expr); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
920 1025 int32 exprtypmod = exprTypmod((const Node *) expr); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
921 1025 Oid exprcollation = exprCollation((const Node *) expr); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
922 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
923 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
924 - * Insert into pg_propgraph_property if not already existing. 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
925 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
926 1025 propoid = GetSysCacheOid2(PROPGRAPHPROPNAME, Anum_pg_propgraph_property_oid, ObjectIdGetDatum(graphid), CStringGetDatum(propname)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
927 1025 if (!OidIsValid(propoid)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
928 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
929 530 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
930 530 NameData propnamedata; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
931 530 Datum values[Natts_pg_propgraph_property] = {0}; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
932 530 bool nulls[Natts_pg_propgraph_property] = {0}; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
933 530 HeapTuple tup; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
934 530 ObjectAddress myself; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
935 530 ObjectAddress referenced; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
936 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
937 530 rel = table_open(PropgraphPropertyRelationId, RowExclusiveLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
938 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
939 530 propoid = GetNewOidWithIndex(rel, PropgraphPropertyObjectIndexId, Anum_pg_propgraph_property_oid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
940 530 values[Anum_pg_propgraph_property_oid - 1] = ObjectIdGetDatum(propoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
941 530 values[Anum_pg_propgraph_property_pgppgid - 1] = ObjectIdGetDatum(graphid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
942 530 namestrcpy(&propnamedata, propname); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
943 530 values[Anum_pg_propgraph_property_pgpname - 1] = NameGetDatum(&propnamedata); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
944 530 values[Anum_pg_propgraph_property_pgptypid - 1] = ObjectIdGetDatum(exprtypid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
945 530 values[Anum_pg_propgraph_property_pgptypmod - 1] = Int32GetDatum(exprtypmod); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
946 530 values[Anum_pg_propgraph_property_pgpcollation - 1] = ObjectIdGetDatum(exprcollation); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
947 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
948 530 tup = heap_form_tuple(RelationGetDescr(rel), values, nulls); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
949 530 CatalogTupleInsert(rel, tup); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
950 530 heap_freetuple(tup); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
951 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
952 530 ObjectAddressSet(myself, PropgraphPropertyRelationId, propoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
953 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
954 530 ObjectAddressSet(referenced, RelationRelationId, graphid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
955 530 recordDependencyOn(&myself, &referenced, DEPENDENCY_AUTO); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
956 530 ObjectAddressSet(referenced, TypeRelationId, exprtypid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
957 530 recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
958 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
959 530 table_close(rel, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
960 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
961 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
962 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
963 495 HeapTuple pgptup = SearchSysCache1(PROPGRAPHPROPOID, ObjectIdGetDatum(propoid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
964 495 Form_pg_propgraph_property pgpform = (Form_pg_propgraph_property) GETSTRUCT(pgptup); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
965 495 Oid proptypid = pgpform->pgptypid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
966 495 int32 proptypmod = pgpform->pgptypmod; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
967 495 Oid propcollation = pgpform->pgpcollation; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
968 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
969 495 ReleaseSysCache(pgptup); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
970 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
971 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
972 - * Check that in the graph, all properties with the same name have the 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
973 - * same type (independent of which label they are on). (See SQL/PGQ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
974 - * subclause "Consistency check of a tabular property graph 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
975 - * descriptor".) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
976 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
977 495 if (proptypid != exprtypid || proptypmod != exprtypmod) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
978 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
979 12 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
980 - errcode(ERRCODE_SYNTAX_ERROR), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
981 - errmsg("property \"%s\" data type mismatch: %s vs. %s", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
982 - propname, format_type_with_typemod(proptypid, proptypmod), format_type_with_typemod(exprtypid, exprtypmod)), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
983 - errdetail("In a property graph, a property of the same name has to have the same data type in each label.")); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
984 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
985 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
986 - /* Similarly for collation */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
987 483 if (propcollation != exprcollation) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
988 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
989 12 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
990 - errcode(ERRCODE_SYNTAX_ERROR), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
991 - errmsg("property \"%s\" collation mismatch: %s vs. %s", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
992 - propname, get_collation_name(propcollation), get_collation_name(exprcollation)), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
993 - errdetail("In a property graph, a property of the same name has to have the same collation in each label.")); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
994 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
995 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
996 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
997 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
998 - * Insert into pg_propgraph_label_property 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
999 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1000 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1001 1001 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1002 1001 Datum values[Natts_pg_propgraph_label_property] = {0}; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1003 1001 bool nulls[Natts_pg_propgraph_label_property] = {0}; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1004 1001 Oid plpoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1005 1001 HeapTuple tup; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1006 1001 ObjectAddress myself; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1007 1001 ObjectAddress referenced; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1008 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1009 1001 rel = table_open(PropgraphLabelPropertyRelationId, RowExclusiveLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1010 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1011 1001 plpoid = GetNewOidWithIndex(rel, PropgraphLabelPropertyObjectIndexId, Anum_pg_propgraph_label_property_oid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1012 1001 values[Anum_pg_propgraph_label_property_oid - 1] = ObjectIdGetDatum(plpoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1013 1001 values[Anum_pg_propgraph_label_property_plppropid - 1] = ObjectIdGetDatum(propoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1014 1001 values[Anum_pg_propgraph_label_property_plpellabelid - 1] = ObjectIdGetDatum(ellabeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1015 1001 values[Anum_pg_propgraph_label_property_plpexpr - 1] = CStringGetTextDatum(nodeToString(expr)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1016 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1017 1001 tup = heap_form_tuple(RelationGetDescr(rel), values, nulls); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1018 1001 CatalogTupleInsert(rel, tup); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1019 1001 heap_freetuple(tup); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1020 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1021 1001 ObjectAddressSet(myself, PropgraphLabelPropertyRelationId, plpoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1022 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1023 1001 ObjectAddressSet(referenced, PropgraphPropertyRelationId, propoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1024 1001 recordDependencyOn(&myself, &referenced, DEPENDENCY_AUTO); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1025 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1026 1001 ObjectAddressSet(referenced, PropgraphElementLabelRelationId, ellabeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1027 1001 recordDependencyOn(&myself, &referenced, DEPENDENCY_AUTO); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1028 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1029 1001 recordDependencyOnSingleRelExpr(&myself, (Node *) copyObject(expr), pgerelid, DEPENDENCY_NORMAL, DEPENDENCY_NORMAL, false); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1030 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1031 1001 table_close(rel, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1032 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1033 1001 } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
check_element_properties() lines 1047-1162
Modified Lines Coverage: 59/64 lines (92.2%)
LineHitsSourceCommit
1047 349 check_element_properties(Oid peoid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1048 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1049 349 Relation rel1; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1050 349 ScanKeyData key1[1]; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1051 349 SysScanDesc scan1; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1052 349 HeapTuple tuple1; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1053 349 List *propoids = NIL; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1054 349 List *propexprs = NIL; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1055 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1056 349 rel1 = table_open(PropgraphElementLabelRelationId, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1057 349 ScanKeyInit(&key1[0], 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1058 - Anum_pg_propgraph_element_label_pgelelid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1059 - BTEqualStrategyNumber, F_OIDEQ, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1060 - ObjectIdGetDatum(peoid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1061 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1062 349 scan1 = systable_beginscan(rel1, PropgraphElementLabelElementLabelIndexId, true, NULL, 1, key1); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1063 805 while (HeapTupleIsValid(tuple1 = systable_getnext(scan1))) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1064 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1065 462 Form_pg_propgraph_element_label ellabel = (Form_pg_propgraph_element_label) GETSTRUCT(tuple1); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1066 462 Relation rel2; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1067 462 ScanKeyData key2[1]; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1068 462 SysScanDesc scan2; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1069 462 HeapTuple tuple2; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1070 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1071 462 rel2 = table_open(PropgraphLabelPropertyRelationId, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1072 462 ScanKeyInit(&key2[0], 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1073 - Anum_pg_propgraph_label_property_plpellabelid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1074 - BTEqualStrategyNumber, F_OIDEQ, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1075 - ObjectIdGetDatum(ellabel->oid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1076 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1077 462 scan2 = systable_beginscan(rel2, PropgraphLabelPropertyLabelPropIndexId, true, NULL, 1, key2); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1078 1439 while (HeapTupleIsValid(tuple2 = systable_getnext(scan2))) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1079 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1080 983 Form_pg_propgraph_label_property lprop = (Form_pg_propgraph_label_property) GETSTRUCT(tuple2); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1081 983 Oid propoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1082 983 Datum datum; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1083 983 bool isnull; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1084 983 char *propexpr; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1085 983 ListCell *lc1, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1086 - *lc2; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1087 983 bool found; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1088 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1089 983 propoid = lprop->plppropid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1090 983 datum = heap_getattr(tuple2, Anum_pg_propgraph_label_property_plpexpr, RelationGetDescr(rel2), &isnull); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1091 983 Assert(!isnull); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1092 983 propexpr = TextDatumGetCString(datum); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1093 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1094 983 found = false; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1095 1942 forboth(lc1, propoids, lc2, propexprs) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1096 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1097 1041 if (propoid == lfirst_oid(lc1)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1098 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1099 82 Node *na, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1100 - *nb; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1101 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1102 82 na = stringToNode(propexpr); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1103 82 nb = stringToNode(lfirst(lc2)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1104 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1105 82 found = true; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1106 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1107 82 if (!equal(na, nb)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1108 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1109 6 HeapTuple tuple3; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1110 6 Form_pg_propgraph_element elform; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1111 6 List *dpcontext; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1112 6 char *dpa, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1113 - *dpb; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1114 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1115 6 tuple3 = SearchSysCache1(PROPGRAPHELOID, ObjectIdGetDatum(peoid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1116 6 if (!tuple3) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1117 0 elog(ERROR, "cache lookup failed for property graph element %u", peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1118 6 elform = (Form_pg_propgraph_element) GETSTRUCT(tuple3); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1119 6 dpcontext = deparse_context_for(get_rel_name(elform->pgerelid), elform->pgerelid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1120 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1121 6 dpa = deparse_expression(na, dpcontext, false, false); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1122 6 dpb = deparse_expression(nb, dpcontext, false, false); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1123 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1124 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1125 - * show in sorted order to keep output independent of 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1126 - * index order 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1127 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1128 6 if (strcmp(dpa, dpb) > 0) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1129 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1130 0 char *tmp; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1131 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1132 0 tmp = dpa; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1133 0 dpa = dpb; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1134 0 dpb = tmp; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1135 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1136 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1137 6 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1138 - errcode(ERRCODE_SYNTAX_ERROR), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1139 - errmsg("element \"%s\" property \"%s\" expression mismatch: %s vs. %s", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1140 - NameStr(elform->pgealias), get_propgraph_property_name(propoid), dpa, dpb), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1141 - errdetail("In a property graph element, a property of the same name has to have the same expression in each label.")); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1142 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1143 - ReleaseSysCache(tuple3); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1144 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1145 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1146 - break; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1147 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1148 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1149 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1150 76 if (!found) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1151 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1152 901 propoids = lappend_oid(propoids, propoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1153 901 propexprs = lappend(propexprs, propexpr); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1154 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1155 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1156 456 systable_endscan(scan2); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1157 456 table_close(rel2, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1158 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1159 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1160 343 systable_endscan(scan1); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1161 343 table_close(rel1, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1162 343 } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
check_element_label_properties() lines 1178-1266
Modified Lines Coverage: 34/35 lines (97.1%)
LineHitsSourceCommit
1178 708 check_element_label_properties(Oid ellabeloid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1179 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1180 708 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1181 708 SysScanDesc scan; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1182 708 ScanKeyData key[1]; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1183 708 HeapTuple tuple; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1184 708 Oid labelid = InvalidOid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1185 708 Oid ref_ellabeloid = InvalidOid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1186 708 List *myprops, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1187 - *refprops; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1188 708 List *diff1, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1189 - *diff2; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1190 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1191 708 rel = table_open(PropgraphElementLabelRelationId, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1192 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1193 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1194 - * Get element label info 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1195 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1196 708 ScanKeyInit(&key[0], 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1197 - Anum_pg_propgraph_element_label_oid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1198 - BTEqualStrategyNumber, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1199 - F_OIDEQ, ObjectIdGetDatum(ellabeloid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1200 708 scan = systable_beginscan(rel, PropgraphElementLabelObjectIndexId, true, NULL, 1, key); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1201 708 if (HeapTupleIsValid(tuple = systable_getnext(scan))) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1202 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1203 708 Form_pg_propgraph_element_label ellabel = (Form_pg_propgraph_element_label) GETSTRUCT(tuple); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1204 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1205 708 labelid = ellabel->pgellabelid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1206 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1207 708 systable_endscan(scan); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1208 708 if (!labelid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1209 0 elog(ERROR, "element label %u not found", ellabeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1210 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1211 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1212 - * Find a reference element label to fetch label properties. The 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1213 - * reference element label has to have the label OID as the one being 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1214 - * checked but be distinct from the one being checked. 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1215 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1216 708 ScanKeyInit(&key[0], 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1217 - Anum_pg_propgraph_element_label_pgellabelid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1218 - BTEqualStrategyNumber, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1219 - F_OIDEQ, ObjectIdGetDatum(labelid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1220 708 scan = systable_beginscan(rel, PropgraphElementLabelLabelIndexId, true, NULL, 1, key); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1221 1167 while (HeapTupleIsValid(tuple = systable_getnext(scan))) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1222 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1223 807 Form_pg_propgraph_element_label otherellabel = (Form_pg_propgraph_element_label) GETSTRUCT(tuple); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1224 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1225 807 if (otherellabel->oid != ellabeloid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1226 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1227 - ref_ellabeloid = otherellabel->oid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1228 - break; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1229 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1230 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1231 708 systable_endscan(scan); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1232 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1233 708 table_close(rel, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1234 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1235 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1236 - * If there is not previous definition of this label, then we are done. 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1237 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1238 708 if (!ref_ellabeloid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1239 360 return; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1240 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1241 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1242 - * Now check number and names. 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1243 - * 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1244 - * XXX We could provide more detail in the error messages, but that would 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1245 - * probably only be useful for some ALTER commands, because otherwise it's 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1246 - * not really clear which label definition is the wrong one, and so you'd 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1247 - * have to construct a rather verbose report to be of any use. Let's keep 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1248 - * it simple for now. 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1249 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1250 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1251 348 myprops = get_element_label_property_names(ellabeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1252 348 refprops = get_element_label_property_names(ref_ellabeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1253 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1254 1044 if (list_length(refprops) != list_length(myprops)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1255 12 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1256 - errcode(ERRCODE_INVALID_OBJECT_DEFINITION), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1257 - errmsg("mismatching number of properties in definition of label \"%s\"", get_propgraph_label_name(labelid))); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1258 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1259 336 diff1 = list_difference(myprops, refprops); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1260 336 diff2 = list_difference(refprops, myprops); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1261 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1262 336 if (diff1 || diff2) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1263 336 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1264 - errcode(ERRCODE_INVALID_OBJECT_DEFINITION), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1265 - errmsg("mismatching properties names in definition of label \"%s\"", get_propgraph_label_name(labelid))); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1266 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
check_all_labels_properties() lines 1272-1281
Modified Lines Coverage: 5/5 lines (100.0%)
LineHitsSourceCommit
1272 132 check_all_labels_properties(Oid pgrelid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1273 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1274 564 foreach_oid(labeloid, get_graph_label_ids(pgrelid)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1275 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1276 1110 foreach_oid(ellabeloid, get_label_element_label_ids(labeloid)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1277 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1278 678 check_element_label_properties(ellabeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1279 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1280 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1281 123 } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
AlterPropGraph() lines 1287-1655
Modified Lines Coverage: 167/180 lines (92.8%)
LineHitsSourceCommit
1287 84 AlterPropGraph(ParseState *pstate, const AlterPropGraphStmt *stmt) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1288 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1289 84 Oid pgrelid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1290 84 ListCell *lc; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1291 84 ObjectAddress pgaddress; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1292 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1293 168 pgrelid = RangeVarGetRelidExtended(stmt->pgname, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1294 - ShareRowExclusiveLock, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1295 84 stmt->missing_ok ? RVR_MISSING_OK : 0, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1296 - RangeVarCallbackOwnsRelation, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1297 - NULL); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1298 84 if (pgrelid == InvalidOid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1299 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1300 0 ereport(NOTICE, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1301 - (errmsg("relation \"%s\" does not exist, skipping", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1302 - stmt->pgname->relname))); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1303 0 return InvalidObjectAddress; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1304 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1305 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1306 84 ObjectAddressSet(pgaddress, RelationRelationId, pgrelid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1307 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1308 96 foreach(lc, stmt->add_vertex_tables) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1309 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1310 18 PropGraphVertex *vertex = lfirst_node(PropGraphVertex, lc); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1311 18 struct element_info *vinfo; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1312 18 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1313 18 Oid peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1314 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1315 18 vinfo = palloc0_object(struct element_info); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1316 18 vinfo->kind = PGEKIND_VERTEX; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1317 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1318 18 vinfo->relid = RangeVarGetRelidExtended(vertex->vtable, AccessShareLock, 0, RangeVarCallbackOwnsRelation, NULL); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1319 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1320 18 rel = table_open(vinfo->relid, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1321 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1322 18 if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP && get_rel_persistence(pgrelid) != RELPERSISTENCE_TEMP) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1323 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1324 - (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1325 - errmsg("cannot add temporary element table to non-temporary property graph"), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1326 - errdetail("Table \"%s\" is a temporary table.", get_rel_name(vinfo->relid)), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1327 - parser_errposition(pstate, vertex->vtable->location))); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1328 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1329 18 if (vertex->vtable->alias) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1330 3 vinfo->aliasname = vertex->vtable->alias->aliasname; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1331 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1332 15 vinfo->aliasname = vertex->vtable->relname; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1333 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1334 18 vinfo->key = propgraph_element_get_key(pstate, vertex->vkey, rel, vinfo->aliasname, vertex->location); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1335 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1336 18 vinfo->labels = vertex->labels; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1337 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1338 18 table_close(rel, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1339 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1340 18 peoid = insert_element_record(pgaddress, vinfo); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1341 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1342 15 CommandCounterIncrement(); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1343 15 check_element_properties(peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1344 12 check_all_labels_properties(pgrelid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1345 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1346 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1347 102 foreach(lc, stmt->add_edge_tables) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1348 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1349 27 PropGraphEdge *edge = lfirst_node(PropGraphEdge, lc); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1350 27 struct element_info *einfo; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1351 27 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1352 27 Relation srcrel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1353 27 Relation destrel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1354 27 Oid peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1355 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1356 27 einfo = palloc0_object(struct element_info); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1357 27 einfo->kind = PGEKIND_EDGE; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1358 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1359 27 einfo->relid = RangeVarGetRelidExtended(edge->etable, AccessShareLock, 0, RangeVarCallbackOwnsRelation, NULL); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1360 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1361 27 rel = table_open(einfo->relid, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1362 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1363 27 if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP && get_rel_persistence(pgrelid) != RELPERSISTENCE_TEMP) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1364 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1365 - (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1366 - errmsg("cannot add temporary element table to non-temporary property graph"), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1367 - errdetail("Table \"%s\" is a temporary table.", get_rel_name(einfo->relid)), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1368 - parser_errposition(pstate, edge->etable->location))); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1369 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1370 27 if (edge->etable->alias) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1371 0 einfo->aliasname = edge->etable->alias->aliasname; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1372 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1373 27 einfo->aliasname = edge->etable->relname; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1374 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1375 27 einfo->key = propgraph_element_get_key(pstate, edge->ekey, rel, einfo->aliasname, edge->location); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1376 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1377 27 einfo->srcvertexid = get_vertex_oid(pstate, pgrelid, edge->esrcvertex, edge->location); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1378 27 einfo->destvertexid = get_vertex_oid(pstate, pgrelid, edge->edestvertex, edge->location); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1379 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1380 27 einfo->srcrelid = get_element_relid(einfo->srcvertexid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1381 27 einfo->destrelid = get_element_relid(einfo->destvertexid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1382 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1383 27 srcrel = table_open(einfo->srcrelid, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1384 27 destrel = table_open(einfo->destrelid, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1385 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1386 27 propgraph_edge_get_ref_keys(pstate, edge->esrckey, edge->esrcvertexcols, rel, srcrel, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1387 27 einfo->aliasname, edge->location, "SOURCE", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1388 - &einfo->srckey, &einfo->srcref, &einfo->srceqop); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1389 27 propgraph_edge_get_ref_keys(pstate, edge->edestkey, edge->edestvertexcols, rel, destrel, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1390 27 einfo->aliasname, edge->location, "DESTINATION", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1391 - &einfo->destkey, &einfo->destref, &einfo->desteqop); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1392 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1393 27 einfo->labels = edge->labels; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1394 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1395 27 table_close(destrel, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1396 27 table_close(srcrel, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1397 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1398 27 table_close(rel, NoLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1399 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1400 27 peoid = insert_element_record(pgaddress, einfo); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1401 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1402 24 CommandCounterIncrement(); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1403 24 check_element_properties(peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1404 24 check_all_labels_properties(pgrelid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1405 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1406 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1407 78 foreach(lc, stmt->drop_vertex_tables) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1408 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1409 6 char *alias = strVal(lfirst(lc)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1410 6 Oid peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1411 6 ObjectAddress obj; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1412 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1413 6 peoid = get_vertex_oid(pstate, pgrelid, alias, -1); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1414 6 ObjectAddressSet(obj, PropgraphElementRelationId, peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1415 6 performDeletion(&obj, stmt->drop_behavior, 0); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1416 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1417 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1418 81 foreach(lc, stmt->drop_edge_tables) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1419 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1420 9 char *alias = strVal(lfirst(lc)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1421 9 Oid peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1422 9 ObjectAddress obj; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1423 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1424 9 peoid = get_edge_oid(pstate, pgrelid, alias, -1); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1425 9 ObjectAddressSet(obj, PropgraphElementRelationId, peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1426 9 performDeletion(&obj, stmt->drop_behavior, 0); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1427 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1428 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1429 - /* Remove any orphaned pg_propgraph_label entries */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1430 72 if (stmt->drop_vertex_tables || stmt->drop_edge_tables) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1431 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1432 57 foreach_oid(labeloid, get_graph_label_ids(pgrelid)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1433 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1434 48 if (!get_label_element_label_ids(labeloid)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1435 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1436 9 ObjectAddress obj; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1437 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1438 9 ObjectAddressSet(obj, PropgraphLabelRelationId, labeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1439 9 performDeletion(&obj, stmt->drop_behavior, 0); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1440 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1441 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1442 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1443 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1444 81 foreach(lc, stmt->add_labels) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1445 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1446 21 PropGraphLabelAndProperties *lp = lfirst_node(PropGraphLabelAndProperties, lc); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1447 21 Oid peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1448 21 Oid pgerelid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1449 21 Oid ellabeloid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1450 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1451 21 Assert(lp->label); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1452 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1453 21 if (stmt->element_kind == PROPGRAPH_ELEMENT_KIND_VERTEX) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1454 21 peoid = get_vertex_oid(pstate, pgrelid, stmt->element_alias, -1); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1455 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1456 0 peoid = get_edge_oid(pstate, pgrelid, stmt->element_alias, -1); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1457 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1458 21 pgerelid = get_element_relid(peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1459 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1460 21 ellabeloid = insert_label_record(pgrelid, peoid, lp->label); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1461 21 insert_property_records(pgrelid, ellabeloid, pgerelid, lp->properties); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1462 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1463 18 CommandCounterIncrement(); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1464 18 check_element_properties(peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1465 18 check_element_label_properties(ellabeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1466 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1467 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1468 60 if (stmt->drop_label) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1469 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1470 9 Oid peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1471 9 Oid labeloid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1472 9 Oid ellabeloid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1473 9 ObjectAddress obj; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1474 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1475 9 if (stmt->element_kind == PROPGRAPH_ELEMENT_KIND_VERTEX) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1476 9 peoid = get_vertex_oid(pstate, pgrelid, stmt->element_alias, -1); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1477 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1478 0 peoid = get_edge_oid(pstate, pgrelid, stmt->element_alias, -1); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1479 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1480 9 labeloid = GetSysCacheOid2(PROPGRAPHLABELNAME, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1481 - Anum_pg_propgraph_label_oid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1482 - ObjectIdGetDatum(pgrelid), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1483 - CStringGetDatum(stmt->drop_label)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1484 9 if (!labeloid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1485 3 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1486 - errcode(ERRCODE_UNDEFINED_OBJECT), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1487 - errmsg("property graph \"%s\" element \"%s\" has no label \"%s\"", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1488 - get_rel_name(pgrelid), stmt->element_alias, stmt->drop_label), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1489 - parser_errposition(pstate, -1)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1490 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1491 6 ellabeloid = GetSysCacheOid2(PROPGRAPHELEMENTLABELELEMENTLABEL, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1492 - Anum_pg_propgraph_element_label_oid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1493 - ObjectIdGetDatum(peoid), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1494 - ObjectIdGetDatum(labeloid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1495 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1496 6 if (!ellabeloid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1497 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1498 - errcode(ERRCODE_UNDEFINED_OBJECT), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1499 - errmsg("property graph \"%s\" element \"%s\" has no label \"%s\"", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1500 - get_rel_name(pgrelid), stmt->element_alias, stmt->drop_label), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1501 - parser_errposition(pstate, -1)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1502 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1503 6 ObjectAddressSet(obj, PropgraphElementLabelRelationId, ellabeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1504 6 performDeletion(&obj, stmt->drop_behavior, 0); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1505 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1506 - /* Remove any orphaned pg_propgraph_label entries */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1507 6 if (!get_label_element_label_ids(labeloid)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1508 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1509 3 ObjectAddressSet(obj, PropgraphLabelRelationId, labeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1510 3 performDeletion(&obj, stmt->drop_behavior, 0); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1511 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1512 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1513 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1514 57 if (stmt->add_properties) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1515 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1516 6 Oid peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1517 6 Oid pgerelid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1518 6 Oid labeloid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1519 6 Oid ellabeloid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1520 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1521 6 if (stmt->element_kind == PROPGRAPH_ELEMENT_KIND_VERTEX) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1522 3 peoid = get_vertex_oid(pstate, pgrelid, stmt->element_alias, -1); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1523 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1524 3 peoid = get_edge_oid(pstate, pgrelid, stmt->element_alias, -1); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1525 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1526 6 labeloid = GetSysCacheOid2(PROPGRAPHLABELNAME, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1527 - Anum_pg_propgraph_label_oid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1528 - ObjectIdGetDatum(pgrelid), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1529 - CStringGetDatum(stmt->alter_label)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1530 6 if (!labeloid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1531 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1532 - errcode(ERRCODE_UNDEFINED_OBJECT), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1533 - errmsg("property graph \"%s\" element \"%s\" has no label \"%s\"", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1534 - get_rel_name(pgrelid), stmt->element_alias, stmt->alter_label), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1535 - parser_errposition(pstate, -1)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1536 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1537 6 ellabeloid = GetSysCacheOid2(PROPGRAPHELEMENTLABELELEMENTLABEL, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1538 - Anum_pg_propgraph_element_label_oid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1539 - ObjectIdGetDatum(peoid), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1540 - ObjectIdGetDatum(labeloid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1541 6 if (!ellabeloid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1542 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1543 - errcode(ERRCODE_UNDEFINED_OBJECT), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1544 - errmsg("property graph \"%s\" element \"%s\" has no label \"%s\"", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1545 - get_rel_name(pgrelid), stmt->element_alias, stmt->alter_label), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1546 - parser_errposition(pstate, -1)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1547 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1548 6 pgerelid = get_element_relid(peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1549 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1550 6 insert_property_records(pgrelid, ellabeloid, pgerelid, stmt->add_properties); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1551 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1552 6 CommandCounterIncrement(); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1553 6 check_element_properties(peoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1554 6 check_element_label_properties(ellabeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1555 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1556 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1557 57 if (stmt->drop_properties) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1558 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1559 6 Oid peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1560 6 Oid labeloid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1561 6 Oid ellabeloid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1562 6 ObjectAddress obj; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1563 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1564 6 if (stmt->element_kind == PROPGRAPH_ELEMENT_KIND_VERTEX) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1565 3 peoid = get_vertex_oid(pstate, pgrelid, stmt->element_alias, -1); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1566 - else 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1567 3 peoid = get_edge_oid(pstate, pgrelid, stmt->element_alias, -1); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1568 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1569 6 labeloid = GetSysCacheOid2(PROPGRAPHLABELNAME, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1570 - Anum_pg_propgraph_label_oid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1571 - ObjectIdGetDatum(pgrelid), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1572 - CStringGetDatum(stmt->alter_label)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1573 6 if (!labeloid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1574 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1575 - errcode(ERRCODE_UNDEFINED_OBJECT), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1576 - errmsg("property graph \"%s\" element \"%s\" has no label \"%s\"", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1577 - get_rel_name(pgrelid), stmt->element_alias, stmt->alter_label), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1578 - parser_errposition(pstate, -1)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1579 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1580 6 ellabeloid = GetSysCacheOid2(PROPGRAPHELEMENTLABELELEMENTLABEL, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1581 - Anum_pg_propgraph_element_label_oid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1582 - ObjectIdGetDatum(peoid), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1583 - ObjectIdGetDatum(labeloid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1584 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1585 6 if (!ellabeloid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1586 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1587 - errcode(ERRCODE_UNDEFINED_OBJECT), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1588 - errmsg("property graph \"%s\" element \"%s\" has no label \"%s\"", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1589 - get_rel_name(pgrelid), stmt->element_alias, stmt->alter_label), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1590 - parser_errposition(pstate, -1)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1591 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1592 12 foreach(lc, stmt->drop_properties) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1593 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1594 6 char *propname = strVal(lfirst(lc)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1595 6 Oid propoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1596 6 Oid plpoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1597 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1598 6 propoid = GetSysCacheOid2(PROPGRAPHPROPNAME, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1599 - Anum_pg_propgraph_property_oid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1600 - ObjectIdGetDatum(pgrelid), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1601 - CStringGetDatum(propname)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1602 6 if (!propoid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1603 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1604 - errcode(ERRCODE_UNDEFINED_OBJECT), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1605 - errmsg("property graph \"%s\" element \"%s\" label \"%s\" has no property \"%s\"", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1606 - get_rel_name(pgrelid), stmt->element_alias, stmt->alter_label, propname), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1607 - parser_errposition(pstate, -1)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1608 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1609 6 plpoid = GetSysCacheOid2(PROPGRAPHLABELPROP, Anum_pg_propgraph_label_property_oid, ObjectIdGetDatum(ellabeloid), ObjectIdGetDatum(propoid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1610 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1611 6 ObjectAddressSet(obj, PropgraphLabelPropertyRelationId, plpoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1612 6 performDeletion(&obj, stmt->drop_behavior, 0); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1613 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1614 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1615 6 check_element_label_properties(ellabeloid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1616 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1617 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1618 - /* Remove any orphaned pg_propgraph_property entries */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1619 57 if (stmt->drop_properties || stmt->drop_vertex_tables || stmt->drop_edge_tables) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1620 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1621 135 foreach_oid(propoid, get_graph_property_ids(pgrelid)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1622 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1623 120 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1624 120 SysScanDesc scan; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1625 120 ScanKeyData key[1]; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1626 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1627 120 rel = table_open(PropgraphLabelPropertyRelationId, RowShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1628 120 ScanKeyInit(&key[0], 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1629 - Anum_pg_propgraph_label_property_plppropid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1630 - BTEqualStrategyNumber, F_OIDEQ, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1631 - ObjectIdGetDatum(propoid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1632 120 scan = systable_beginscan(rel, InvalidOid /* FIXME */ , 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1633 - true, NULL, 1, key); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1634 120 if (!systable_getnext(scan)) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1635 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1636 15 ObjectAddress obj; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1637 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1638 15 ObjectAddressSet(obj, PropgraphPropertyRelationId, propoid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1639 15 performDeletion(&obj, stmt->drop_behavior, 0); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1640 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1641 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1642 120 systable_endscan(scan); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1643 120 table_close(rel, RowShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1644 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1645 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1646 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1647 - /* 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1648 - * Invalidate relcache entry of the property graph so that the queries in 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1649 - * the cached plans referencing the property graph will be rewritten 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1650 - * considering changes to the propert graph. 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1651 - */ 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1652 57 CacheInvalidateRelcacheByRelid(pgrelid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1653 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1654 57 return pgaddress; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1655 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
get_vertex_oid() lines 1662-1687
Modified Lines Coverage: 9/11 lines (81.8%)
LineHitsSourceCommit
1662 96 get_vertex_oid(ParseState *pstate, Oid pgrelid, const char *alias, int location) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1663 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1664 96 HeapTuple tuple; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1665 96 Oid peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1666 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1667 96 tuple = SearchSysCache2(PROPGRAPHELALIAS, ObjectIdGetDatum(pgrelid), CStringGetDatum(alias)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1668 96 if (!tuple) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1669 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1670 - errcode(ERRCODE_UNDEFINED_OBJECT), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1671 - errmsg("property graph \"%s\" has no element with alias \"%s\"", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1672 - get_rel_name(pgrelid), alias), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1673 - parser_errposition(pstate, location)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1674 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1675 96 if (((Form_pg_propgraph_element) GETSTRUCT(tuple))->pgekind != PGEKIND_VERTEX) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1676 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1677 - errcode(ERRCODE_SYNTAX_ERROR), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1678 - errmsg("element \"%s\" of property graph \"%s\" is not a vertex", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1679 - alias, get_rel_name(pgrelid)), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1680 - parser_errposition(pstate, location)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1681 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1682 96 peoid = ((Form_pg_propgraph_element) GETSTRUCT(tuple))->oid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1683 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1684 96 ReleaseSysCache(tuple); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1685 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1686 96 return peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1687 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
get_edge_oid() lines 1694-1719
Modified Lines Coverage: 9/11 lines (81.8%)
LineHitsSourceCommit
1694 15 get_edge_oid(ParseState *pstate, Oid pgrelid, const char *alias, int location) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1695 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1696 15 HeapTuple tuple; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1697 15 Oid peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1698 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1699 15 tuple = SearchSysCache2(PROPGRAPHELALIAS, ObjectIdGetDatum(pgrelid), CStringGetDatum(alias)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1700 15 if (!tuple) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1701 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1702 - errcode(ERRCODE_UNDEFINED_OBJECT), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1703 - errmsg("property graph \"%s\" has no element with alias \"%s\"", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1704 - get_rel_name(pgrelid), alias), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1705 - parser_errposition(pstate, location)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1706 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1707 15 if (((Form_pg_propgraph_element) GETSTRUCT(tuple))->pgekind != PGEKIND_EDGE) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1708 0 ereport(ERROR, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1709 - errcode(ERRCODE_SYNTAX_ERROR), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1710 - errmsg("element \"%s\" of property graph \"%s\" is not an edge", 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1711 - alias, get_rel_name(pgrelid)), 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1712 - parser_errposition(pstate, location)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1713 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1714 15 peoid = ((Form_pg_propgraph_element) GETSTRUCT(tuple))->oid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1715 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1716 15 ReleaseSysCache(tuple); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1717 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1718 15 return peoid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1719 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
get_element_relid() lines 1725-1739
Modified Lines Coverage: 8/9 lines (88.9%)
LineHitsSourceCommit
1725 81 get_element_relid(Oid peid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1726 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1727 81 HeapTuple tuple; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1728 81 Oid pgerelid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1729 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1730 81 tuple = SearchSysCache1(PROPGRAPHELOID, ObjectIdGetDatum(peid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1731 81 if (!tuple) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1732 0 elog(ERROR, "cache lookup failed for property graph element %u", peid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1733 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1734 81 pgerelid = ((Form_pg_propgraph_element) GETSTRUCT(tuple))->pgerelid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1735 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1736 81 ReleaseSysCache(tuple); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1737 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1738 81 return pgerelid; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1739 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
get_graph_label_ids() lines 1745-1767
Modified Lines Coverage: 14/14 lines (100.0%)
LineHitsSourceCommit
1745 141 get_graph_label_ids(Oid graphid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1746 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1747 141 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1748 141 SysScanDesc scan; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1749 141 ScanKeyData key[1]; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1750 141 HeapTuple tuple; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1751 141 List *result = NIL; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1752 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1753 141 rel = table_open(PropgraphLabelRelationId, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1754 141 ScanKeyInit(&key[0], 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1755 - Anum_pg_propgraph_label_pglpgid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1756 - BTEqualStrategyNumber, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1757 - F_OIDEQ, ObjectIdGetDatum(graphid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1758 141 scan = systable_beginscan(rel, PropgraphLabelGraphNameIndexId, true, NULL, 1, key); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1759 630 while (HeapTupleIsValid(tuple = systable_getnext(scan))) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1760 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1761 489 result = lappend_oid(result, ((Form_pg_propgraph_label) GETSTRUCT(tuple))->oid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1762 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1763 141 systable_endscan(scan); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1764 141 table_close(rel, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1765 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1766 141 return result; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1767 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
get_label_element_label_ids() lines 1773-1795
Modified Lines Coverage: 14/14 lines (100.0%)
LineHitsSourceCommit
1773 495 get_label_element_label_ids(Oid labelid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1774 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1775 495 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1776 495 SysScanDesc scan; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1777 495 ScanKeyData key[1]; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1778 495 HeapTuple tuple; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1779 495 List *result = NIL; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1780 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1781 495 rel = table_open(PropgraphElementLabelRelationId, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1782 495 ScanKeyInit(&key[0], 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1783 - Anum_pg_propgraph_element_label_pgellabelid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1784 - BTEqualStrategyNumber, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1785 - F_OIDEQ, ObjectIdGetDatum(labelid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1786 495 scan = systable_beginscan(rel, PropgraphElementLabelLabelIndexId, true, NULL, 1, key); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1787 1269 while (HeapTupleIsValid(tuple = systable_getnext(scan))) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1788 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1789 774 result = lappend_oid(result, ((Form_pg_propgraph_element_label) GETSTRUCT(tuple))->oid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1790 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1791 495 systable_endscan(scan); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1792 495 table_close(rel, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1793 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1794 495 return result; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1795 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
get_element_label_property_names() lines 1804-1832
Modified Lines Coverage: 15/15 lines (100.0%)
LineHitsSourceCommit
1804 696 get_element_label_property_names(Oid ellabeloid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1805 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1806 696 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1807 696 SysScanDesc scan; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1808 696 ScanKeyData key[1]; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1809 696 HeapTuple tuple; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1810 696 List *result = NIL; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1811 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1812 696 rel = table_open(PropgraphLabelPropertyRelationId, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1813 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1814 696 ScanKeyInit(&key[0], 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1815 - Anum_pg_propgraph_label_property_plpellabelid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1816 - BTEqualStrategyNumber, F_OIDEQ, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1817 - ObjectIdGetDatum(ellabeloid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1818 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1819 696 scan = systable_beginscan(rel, PropgraphLabelPropertyLabelPropIndexId, true, NULL, 1, key); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1820 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1821 1802 while ((tuple = systable_getnext(scan))) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1822 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1823 1106 Form_pg_propgraph_label_property plpform = (Form_pg_propgraph_label_property) GETSTRUCT(tuple); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1824 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1825 1106 result = lappend(result, makeString(get_propgraph_property_name(plpform->plppropid))); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1826 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1827 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1828 696 systable_endscan(scan); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1829 696 table_close(rel, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1830 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1831 696 return result; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1832 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
get_graph_property_ids() lines 1838-1860
Modified Lines Coverage: 14/14 lines (100.0%)
LineHitsSourceCommit
1838 15 get_graph_property_ids(Oid graphid) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1839 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1840 15 Relation rel; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1841 15 SysScanDesc scan; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1842 15 ScanKeyData key[1]; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1843 15 HeapTuple tuple; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1844 15 List *result = NIL; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1845 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1846 15 rel = table_open(PropgraphPropertyRelationId, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1847 15 ScanKeyInit(&key[0], 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1848 - Anum_pg_propgraph_property_pgppgid, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1849 - BTEqualStrategyNumber, 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1850 - F_OIDEQ, ObjectIdGetDatum(graphid)); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1851 15 scan = systable_beginscan(rel, PropgraphPropertyNameIndexId, true, NULL, 1, key); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1852 135 while (HeapTupleIsValid(tuple = systable_getnext(scan))) 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1853 - { 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1854 120 result = lappend_oid(result, ((Form_pg_propgraph_property) GETSTRUCT(tuple))->oid); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1855 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1856 15 systable_endscan(scan); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1857 15 table_close(rel, AccessShareLock); 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1858 - 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1859 15 return result; 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
1860 - } 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)