child/parent creation

From: Dennis Gearon <gearond(at)sbcglobal(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: child/parent creation
Date: 2010-05-29 18:05:42
Message-ID: 42422.64675.qm@web82105.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is it possible to create a complex schema object in one transaction, using prepared statements to protect(somewaht) against SQL 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, sequence keys.

So, using a script language, the procedure I'm doing now is creating one node, getting the id with another query (because of 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), transaction without 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Wilcox 2010-05-29 18:27:53 Re: Out of Memory and Configuration Problems (Big Computer)
Previous Message Bill Moran 2010-05-29 17:55:52 Re: Out of Memory and Configuration Problems (Big Computer)