/[pgestraier]/trunk/bin/pgest-index.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/pgest-index.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 63 by dpavlin, Mon Aug 7 14:30:55 2006 UTC revision 65 by dpavlin, Mon Aug 7 14:47:00 2006 UTC
# Line 130  while (my $row = $sth->fetchrow_hashref( Line 130  while (my $row = $sth->fetchrow_hashref(
130    
131  }  }
132    
133  my $cols = "'" . join("','", @cols) . "'";  my $cols = "'" . join("', '", @cols) . "'";
134    
135  foreach my $t (qw/UPDATE INSERT DELETE/) {  foreach my $t (qw/UPDATE INSERT DELETE/) {
136    
# Line 153  foreach my $t (qw/UPDATE INSERT DELETE/) Line 153  foreach my $t (qw/UPDATE INSERT DELETE/)
153  }  }
154    
155  $dbh->commit;  $dbh->commit;
156    
157    my $col_names = join(', ', @cols);
158    my $col_def = join(', ', map { "$_ text" } @cols);
159    
160    print "example SQL search query:
161    
162    
163    SELECT $col_names
164    FROM pgest(
165            -- node, login, passwd, depth
166            '$c->{node_url}', '$c->{user}', '$c->{passwd}', 0,
167            -- full text search
168            'foo bar',
169            -- attribute filter, order by, limit, offset
170            null, null, null, null,
171            -- return columns
172            array[$cols]
173    ) as ($col_def);
174    
175    ";

Legend:
Removed from v.63  
changed lines
  Added in v.65

  ViewVC Help
Powered by ViewVC 1.1.26