child/parent creation - Mailing list pgsql-general

From Dennis Gearon
Subject child/parent creation
Date
Msg-id 42422.64675.qm@web82105.mail.mud.yahoo.com
Whole thread Raw
Responses Re: child/parent creation  (Justin Graf <justin@magwerks.com>)
Re: child/parent creation  (Richard Broersma <richard.broersma@gmail.com>)
List pgsql-general
Is it possible to create a complex schema object in one transaction, using prepared statements to protect(somewaht)
againstSQL injection? 

Example: A 'family tree object' (having obvious relationships) consisting of:

Table grandparent
Table parent
table childA
table childB

If I have all the information for each 'sub-object' in the 'family tree object', but of course, the primary, integer,
sequencekeys. 

So, using a script language, the procedure I'm doing now is creating one node, getting the id with another query
(becauseof a (reported and actual) bug in the Doctrine ORM), and then creating the next level down. 

My application has nothing to do with family trees, actually, just an example.


each of the (relevant) primary keys is a BIGSERIL, sequence backed, BIGINT.

Can the whole three level, 4 member hierarchy be created in one, prepared statement(to avoid SQL injection),
transactionwithout shuttling any information back and forth between the database and the calling script? 

Thanks in advance.

Dennis Gearon

Signature Warning
----------------
EARTH has a Right To Life,
  otherwise we all die.

Read 'Hot, Flat, and Crowded'
Laugh at http://www.yert.com/film.php


pgsql-general by date:

Previous
From: Bill Moran
Date:
Subject: Re: Out of Memory and Configuration Problems (Big Computer)
Next
From: Justin Graf
Date:
Subject: Re: child/parent creation