Index: openacs-4/packages/acs-subsite/tcl/group-type-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/group-type-procs-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/tcl/group-type-procs-postgresql.xql 15 Jul 2002 18:32:16 -0000 1.3 +++ openacs-4/packages/acs-subsite/tcl/group-type-procs-postgresql.xql 14 Jun 2018 09:16:48 -0000 1.4 @@ -72,23 +72,5 @@ - - - - -begin - create table $table_name ( - $id_column integer - constraint $constraint(pk) primary key - constraint $constraint(fk) - references $references_table ($references_column) - ); - return null; -end; - - - - - Index: openacs-4/packages/acs-subsite/tcl/group-type-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/group-type-procs.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-subsite/tcl/group-type-procs.tcl 9 May 2018 15:33:28 -0000 1.9 +++ openacs-4/packages/acs-subsite/tcl/group-type-procs.tcl 14 Jun 2018 09:16:48 -0000 1.10 @@ -1,5 +1,3 @@ -# /packages/mbryzek-subsite/tcl/group-type-procs.tcl - ad_library { Procs for creating group types @@ -148,15 +146,18 @@ } # The following create table statement commits the - # transaction. If it fails, we roll back what we've done - if { [catch {db_exec_plsql create_table " -create table $table_name ( - $id_column integer - constraint $constraint(pk) primary key - constraint $constraint(fk) - references $references_table ($references_column) -)"} errmsg] } { - # Roll back our work so for + # transaction. If it fails, we roll back what we've done. + + if { [catch {db_exec_plsql create_table [subst { + create table $table_name ( + $id_column integer + constraint $constraint(pk) primary key + constraint $constraint(fk) + references $references_table ($references_column) + )}]} errmsg] } { + + # Roll back our work so far + for { set i [expr {[llength $plsql_drop] - 1}] } { $i >= 0 } { incr i -1 } { set pair [lindex $plsql_drop $i] if { [catch {db_exec_plsql [lindex $drop_pair 0] [lindex $drop_pair 1]} err_msg_2] } { Index: openacs-4/packages/acs-subsite/tcl/rel-types-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/rel-types-procs-postgresql.xql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-subsite/tcl/rel-types-procs-postgresql.xql 7 Aug 2017 23:47:58 -0000 1.9 +++ openacs-4/packages/acs-subsite/tcl/rel-types-procs-postgresql.xql 14 Jun 2018 09:16:48 -0000 1.10 @@ -59,17 +59,6 @@ - - - - create table $table_name ( - rel_id integer constraint $fk_constraint_name - references $references_table ($references_column) - constraint $pk_constraint_name primary key - ); - - - select acs_rel_type__create_role(:role, :pretty_name, :pretty_plural) Index: openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl 9 May 2018 15:33:28 -0000 1.16 +++ openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl 14 Jun 2018 09:16:48 -0000 1.17 @@ -1,5 +1,3 @@ -# /packages/mbryzek-subsite/tcl/rel-types-procs.tcl - ad_library { Procs about relationships @@ -165,17 +163,18 @@ } # The following create table statement commits the transaction. If it - # fails, we roll back what we've done + # fails, we roll back what we've done. if {$create_table_p == "t"} { - if {[catch {db_exec_plsql create_table " - create table $table_name ( - rel_id constraint $fk_constraint_name - references $references_table ($references_column) - constraint $pk_constraint_name primary key - )"} errmsg]} { + if {[catch {db_exec_plsql create_table [subst { + create table $table_name ( + rel_id integer + constraint $fk_constraint_name + references $references_table ($references_column) + constraint $pk_constraint_name primary key + )}]} errmsg]} { - # Roll back our work so for + # Roll back our work so far for {set i [expr {[llength $plsql_drop] - 1}]} {$i >= 0} {incr i -1} { set drop_cmd [lindex $plsql_drop $i]