Received: from h97.c194.tor.velocet.net (H97.C194.tor.velocet.net [216.138.194.97]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g1ICeJE35058 for ; Mon, 18 Feb 2002 07:40:22 -0500 (EST) (envelope-from rbt@zort.ca) Received: (qmail 67423 invoked by uid 0); 18 Feb 2002 12:40:15 -0000 Received: from h97.c194.tor.velocet.net (HELO jester) (216.138.194.97) by 192.168.1.11 with RC4-MD5 encrypted SMTP; 18 Feb 2002 12:40:15 -0000 Message-ID: <019001c1b879$6b4a2760$8001a8c0@jester> From: "Rod Taylor" To: "Christopher Kings-Lynne" , "Hackers" , References: Subject: Re: Function to split pg_trigger.tgargs Date: Mon, 18 Feb 2002 07:40:16 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Archive-Number: 200202/612 X-Sequence-Number: 18905 http://www.zort.ca/postgresql/postgresql_autodoc_0.50.tar.gz The below is taken from the above. my $args = $forcols->{'args'}; my $nargs = $forcols->{'number_args'}; if ($nargs == 6) { my ( $keyname , $table , $ftable , $unspecified , $lcolumn_name , $fcolumn_name ) = split(/\000/, $args); $structure{$group}{$table_name}{'COLUMN'}{$lcolumn_name}{'FK'} = "$ftable"; #.$fcolumn_name"; # print " FK $lcolumn_name -> $ftable.$fcolumn_name\n"; } elsif (($nargs - 6) % 2 == 0) { my ( $keyname , $table , $ftable , $unspecified , $lcolumn_name , $fcolumn_name , @junk ) = split(/\000/, $args); my $key_cols = "$lcolumn_name"; my $ref_cols = "$fcolumn_name"; while ($lcolumn_name = pop(@junk) and $fcolumn_name = pop(@junk)) { $key_cols .= ", $lcolumn_name"; $ref_cols .= ", $fcolumn_name"; } $structure{$group}{$table_name}{'CONSTRAINT'}{$constraint_name} = "FOREIGN KEY ($key_cols) REFERENCES $ftable($ref_cols)"; } -- Rod Taylor This message represents the official view of the voices in my head ----- Original Message ----- From: "Christopher Kings-Lynne" To: "Hackers" ; Sent: Monday, February 18, 2002 12:35 AM Subject: [HACKERS] Function to split pg_trigger.tgargs > Hi All, > > Is there a function in the catalogs somewhere that will split this?: > > australia=# select tgargs from pg_trigger where oid=3842228; > tgargs > > -------------------------------------------------------------------- -------- > ------ > -------------- > > \000users_mealplans_prefs\000medidiets_meals\000UNSPECIFIED\0 00meal > _id\0 > 00meal_id\000 > (1 row) > > I'm hoping to do the splitting within pl/pgsql even. If there is no > function to break it up, can someone please suggest how I would code taking > this string and breaking it into components. > > Chris > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org >