163
163
164
164
# Split line into tokens without interpreting their meaning.
165
165
my %bki_values ;
166
- @bki_values {@attnames } = Catalog::SplitDataLine($row -> {bki_values });
166
+ @bki_values {@attnames } =
167
+ Catalog::SplitDataLine($row -> {bki_values });
167
168
168
169
# Perform required substitutions on fields
169
170
foreach my $att (keys %bki_values )
170
171
{
172
+
171
173
# Substitute constant values we acquired above.
172
174
# (It's intentional that this can apply to parts of a field).
173
175
$bki_values {$att } =~s /\b PGUID\b / $BOOTSTRAP_SUPERUSERID / g ;
178
180
# just do nothing (regprocin will complain).
179
181
if ($bki_attr {$att }-> {type }eq ' regproc' )
180
182
{
181
- my $procoid =$regprocoids {$bki_values {$att }};
183
+ my $procoid =$regprocoids {$bki_values {$att } };
182
184
$bki_values {$att } =$procoid
183
- if defined ($procoid ) &&$procoid ne ' MULTIPLE' ;
185
+ if defined ($procoid ) &&$procoid ne ' MULTIPLE' ;
184
186
}
185
187
}
186
188
187
189
# Save pg_proc oids for use in later regproc substitutions.
188
190
# This relies on the order we process the files in!
189
191
if ($catname eq ' pg_proc' )
190
192
{
191
- if (defined ($regprocoids {$bki_values {proname }}))
193
+ if (defined ($regprocoids {$bki_values {proname } }))
192
194
{
193
- $regprocoids {$bki_values {proname }} =' MULTIPLE' ;
195
+ $regprocoids {$bki_values {proname } } =' MULTIPLE' ;
194
196
}
195
197
else
196
198
{
197
- $regprocoids {$bki_values {proname }} =$row -> {oid };
199
+ $regprocoids {$bki_values {proname } } =$row -> {oid };
198
200
}
199
201
}
200
202
211
213
printf $bki " insert%s (%s )\n " ,$oid ,
212
214
join (' ' ,@bki_values {@attnames });
213
215
214
- # Write comments to postgres.description and postgres.shdescription
216
+ # Write comments to postgres.description and postgres.shdescription
215
217
if (defined $row -> {descr })
216
218
{
217
219
printf $descr " %s \t %s \t 0\t %s \n " ,$row -> {oid },$catname ,
@@ -459,7 +461,8 @@ sub bki_insert
459
461
my $row =shift ;
460
462
my @attnames =@_ ;
461
463
my $oid =$row -> {oid } ?" OID =$row ->{oid}" :' ' ;
462
- my $bki_values =join ' ' ,map {$_ eq ' ' ?' ""' :$_ }map $row -> {$_ },@attnames ;
464
+ my $bki_values =join ' ' ,map {$_ eq ' ' ?' ""' :$_ }map $row -> {$_ },
465
+ @attnames ;
463
466
printf $bki " insert%s (%s )\n " ,$oid ,$bki_values ;
464
467
}
465
468
@@ -474,9 +477,9 @@ sub emit_schemapg_row
474
477
$row -> {attidentity } ||=' \0' ;
475
478
476
479
# Supply appropriate quoting for these fields.
477
- $row -> {attname } =q| {"| .$row -> {attname } .q| "}| ;
478
- $row -> {attstorage } =q| '| .$row -> {attstorage } .q| '| ;
479
- $row -> {attalign } =q| '| .$row -> {attalign } .q| '| ;
480
+ $row -> {attname } =q| {"| .$row -> {attname } .q| "}| ;
481
+ $row -> {attstorage } =q| '| .$row -> {attstorage } .q| '| ;
482
+ $row -> {attalign } =q| '| .$row -> {attalign } .q| '| ;
480
483
$row -> {attidentity } =q| '| .$row -> {attidentity } .q| '| ;
481
484
482
485
# We don't emit initializers for the variable length fields at all.