~ubuntu-branches/ubuntu/hardy/postgresql-common/hardy-backports

« back to all changes in this revision

Viewing changes to t/060_obsolete_confparams.t

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2007-10-21 16:01:08 UTC
  • Revision ID: james.westby@ubuntu.com-20071021160108-6bp6fxhst130l0do
Tags: 80
* pg_upgradecluster: Fix locale error checking.
* pg_upgradecluster: Use cluster_exists() instead of
  cluster_data_directory().
* PgCommon.pm: Fix cluster_data_directory() to consider the data_directory
  setting in postgresql.conf, which should trump the /pgdata symbolic link.
* debian/init.d-functions: Check for 'postgresql.conf' instead of 'pgdata'
  in the test for a valid cluster configuration directory, since 'pgdata' is
  optional now.
* pg_createcluster: Do not create pgdata symlinks to the data directory in
  /etc any more when configuring a >= 8.0 cluster. Use the data_directory
  configuration option instead. (Part of #444689)
* t/020_create_sql_remove.t: Check that clusters still work when replacing
  the data_directory setting with a pgdata symbolic link, and that
  the data_directory setting trumps the symlink.
* pg_upgradecluster: Set correct data_directory config option after copying
  over the old configuration files.
* t/060_obsolete_confparams.t: Restore data_directory setting after
  scribbling over the configuration file with our template.
* PgCommon.pm, cluster_info(): Only return a value for 'logfile' when it is
  not explicitly configured with log_directory and/or log_filename. The
  previous guessing was wrong anyway, since PostgreSQL always appends a
  pretty unpredictable timestamp.
* pg_ctlcluster: Only do log file checks and pass pg_ctl -l option when the
  log file default is used. Otherwise let PostgreSQL do its logfile handling
  and waive log file checks, since we don't know which file is used.
* pg_ctlcluster: Redirect pg_ctl's stdout and stderr to /dev/null, otherwise
  it will hang forever when using a custom log file (and thus not passing
  -l).
* pg_lsclusters: Print "custom" as log file location if a custom one was set
  in postgresql.conf.
* pg_upgradecluster: Enable 'redirect_stderr' in the 7.4 -> 8.x migration of
  'syslog' -> 'log_destination', so that the log output is actually
  complete.
* t/060_obsolete_confparams.t: Enable 'redirect_stderr' in the template
  postgresql.conf's, so that we actually capture log output.
* t/020_create_sql_remove.t: Check proper handling of logs when configuring
  log file in postgresql.conf, using the log symlink, or having neither.
* PgCommon.pm, cluster_info(): Return default log file in 'logfile' if
  neither postgresql.conf nor a 'log' symlink explicitly specify a log file.
* pg_createcluster: Do not create log symlink if using the default log file
  (i. e. when not using -l). (Closes: #444689)
* t/020_create_sql_remove.t: Verify that log symlink is not created by
  default.
* architecture.html: Update to current reality.
* debian/postgresql-common.config: Do not consider versions as obsolete if
  they are newer than the latest officially supported version. This avoids
  confusion when testing new betas in experimental or using backports.
  (Closes: #446635)
* t/TestLib.pm: Make exec_as() work with user name 'root' (not just uid 0).
* Add t/130_nonroot_admin.t: Check that administrative pg_ tools work as
  non-root, too, if the invoker has sufficient permissions on the
  directories (test case for LP #90036).
* pg_{create,drop,upgrade}cluster: Small tweaks to make the scripts work for
  non-root users with sufficient write permissions to
  /etc/postgresql/<version>, /var/lib/postgresql/<version>, and
  /var/log/postgresql. (LP: #90036)

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
from_collapse_limit = 8
172
172
join_collapse_limit = 8 
173
173
log_destination = 'stderr'      
174
 
redirect_stderr = false    
 
174
redirect_stderr = true    
175
175
log_directory = '.'   
176
176
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' 
177
177
log_truncate_on_rotation = false  
303
303
from_collapse_limit = 8
304
304
join_collapse_limit = 8
305
305
log_destination = 'stderr'
306
 
redirect_stderr = off
 
306
redirect_stderr = on
307
307
log_directory = '.'
308
308
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
309
309
log_truncate_on_rotation = off
373
373
custom_variable_classes = 'foo'
374
374
";
375
375
 
 
376
$fullconf{'8.2'} = "external_pid_file = '(none)'
 
377
listen_addresses = 'localhost'
 
378
port = 5432
 
379
max_connections = 100
 
380
superuser_reserved_connections = 3
 
381
unix_socket_directory = ''
 
382
unix_socket_group = ''
 
383
unix_socket_permissions = 0777
 
384
bonjour_name = ''
 
385
authentication_timeout = 1min
 
386
ssl = off
 
387
password_encryption = on
 
388
db_user_namespace = off
 
389
krb_server_keyfile = ''
 
390
krb_srvname = 'postgres'
 
391
krb_server_hostname = ''
 
392
krb_caseins_users = off
 
393
tcp_keepalives_idle = 0
 
394
tcp_keepalives_interval = 0
 
395
tcp_keepalives_count = 0
 
396
shared_buffers = 1000
 
397
temp_buffers = 8MB
 
398
max_prepared_transactions = 5
 
399
work_mem = 1MB
 
400
maintenance_work_mem = 16MB
 
401
max_stack_depth = 2MB
 
402
max_fsm_pages = 1638400
 
403
max_fsm_relations = 1000
 
404
max_files_per_process = 1000
 
405
shared_preload_libraries = ''
 
406
vacuum_cost_delay = 0
 
407
vacuum_cost_page_hit = 1
 
408
vacuum_cost_page_miss = 10
 
409
vacuum_cost_page_dirty = 20
 
410
vacuum_cost_limit = 200
 
411
bgwriter_delay = 200ms
 
412
bgwriter_lru_percent = 1.0
 
413
bgwriter_lru_maxpages = 5
 
414
bgwriter_all_percent = 0.333
 
415
bgwriter_all_maxpages = 5
 
416
fsync = on
 
417
wal_sync_method = fsync
 
418
full_page_writes = on
 
419
wal_buffers = 64kB
 
420
commit_delay = 0
 
421
commit_siblings = 5
 
422
checkpoint_segments = 3
 
423
checkpoint_timeout = 5min
 
424
checkpoint_warning = 30s
 
425
archive_command = ''
 
426
archive_timeout = 0
 
427
enable_bitmapscan = on
 
428
enable_hashagg = on
 
429
enable_hashjoin = on
 
430
enable_indexscan = on
 
431
enable_mergejoin = on
 
432
enable_nestloop = on
 
433
enable_seqscan = on
 
434
enable_sort = on
 
435
enable_tidscan = on
 
436
seq_page_cost = 1.0
 
437
random_page_cost = 4.0
 
438
cpu_tuple_cost = 0.01
 
439
cpu_index_tuple_cost = 0.005
 
440
cpu_operator_cost = 0.0025
 
441
effective_cache_size = 128MB
 
442
geqo = on
 
443
geqo_threshold = 12
 
444
geqo_effort = 5
 
445
geqo_pool_size = 0
 
446
geqo_generations = 0
 
447
geqo_selection_bias = 2.0
 
448
default_statistics_target = 10
 
449
constraint_exclusion = off
 
450
from_collapse_limit = 8
 
451
join_collapse_limit = 8
 
452
log_destination = 'stderr'
 
453
redirect_stderr = on
 
454
log_directory = '.'
 
455
log_filename = 'postgresql-%Y-%m-%d_%H%M'
 
456
log_truncate_on_rotation = off
 
457
log_rotation_age = 1d
 
458
log_rotation_size = 10MB
 
459
syslog_facility = 'LOCAL0'
 
460
syslog_ident = 'postgres'
 
461
client_min_messages = notice
 
462
log_min_messages = notice
 
463
log_error_verbosity = default
 
464
log_min_error_statement = error
 
465
log_min_duration_statement = -1
 
466
silent_mode = off
 
467
debug_print_parse = off
 
468
debug_print_rewritten = off
 
469
debug_print_plan = off
 
470
debug_pretty_print = off
 
471
log_connections = off
 
472
log_disconnections = off
 
473
log_duration = off
 
474
log_line_prefix = ''
 
475
log_statement = 'none'
 
476
log_hostname = off
 
477
stats_command_string = on
 
478
update_process_title = on
 
479
stats_start_collector = on
 
480
stats_block_level = off
 
481
stats_row_level = off
 
482
stats_reset_on_server_start = off
 
483
log_parser_stats = off
 
484
log_planner_stats = off
 
485
log_executor_stats = off
 
486
log_statement_stats = off
 
487
autovacuum = off
 
488
autovacuum_naptime = 1min
 
489
autovacuum_vacuum_threshold = 500
 
490
autovacuum_analyze_threshold = 250
 
491
autovacuum_vacuum_scale_factor = 0.2
 
492
autovacuum_analyze_scale_factor = 0.1
 
493
autovacuum_freeze_max_age = 200000000
 
494
autovacuum_vacuum_cost_delay = -1
 
495
autovacuum_vacuum_cost_limit = -1
 
496
search_path = '\"\$user\",public'
 
497
default_tablespace = ''
 
498
check_function_bodies = on
 
499
default_transaction_isolation = 'read committed'
 
500
default_transaction_read_only = off
 
501
statement_timeout = 0
 
502
vacuum_freeze_min_age = 100000000
 
503
datestyle = 'iso, mdy'
 
504
timezone = unknown
 
505
timezone_abbreviations = 'Default'
 
506
extra_float_digits = 0
 
507
client_encoding = sql_ascii
 
508
lc_messages = 'C'
 
509
lc_monetary = 'C'
 
510
lc_numeric = 'C'
 
511
lc_time = 'C'
 
512
explain_pretty_print = on
 
513
dynamic_library_path = '\$libdir'
 
514
local_preload_libraries = ''
 
515
deadlock_timeout = 1s
 
516
max_locks_per_transaction = 64
 
517
add_missing_from = off
 
518
array_nulls = on
 
519
backslash_quote = safe_encoding
 
520
default_with_oids = off
 
521
escape_string_warning = on
 
522
standard_conforming_strings = off
 
523
regex_flavor = advanced
 
524
sql_inheritance = on
 
525
transform_null_equals = off
 
526
custom_variable_classes = 'foo'
 
527
";
 
528
 
376
529
# create cluster for oldest version
377
530
is ((system "pg_createcluster $MAJORS[0] main >/dev/null"), 0, "pg_createcluster $MAJORS[0] main");
378
531
 
383
536
    my $new = $testversions[0];
384
537
 
385
538
    # Write configuration file and start
 
539
    my $datadir = PgCommon::cluster_data_directory $cur, 'main';
386
540
    open F, ">/etc/postgresql/$cur/main/postgresql.conf" or 
387
541
        die "could not open /etc/postgresql/$cur/main/postgresql.conf";
388
542
    die "\$fullconf{$cur} is not defined" unless exists $fullconf{$cur};
389
543
    print F $fullconf{$cur};
390
 
    is ((exec_as 'postgres', "pg_ctlcluster $cur main start 2>/dev/null"), 0,
 
544
    close F;
 
545
    # restore data directory, we just scribbled over it
 
546
    if ($cur ge '8.0') {
 
547
        PgCommon::set_conf_value $cur, 'main', 'postgresql.conf', 'data_directory', $datadir;
 
548
    }
 
549
 
 
550
    is ((exec_as 'postgres', "pg_ctlcluster $cur main start"), 0,
391
551
        'pg_ctlcluster start');
392
552
    like_program_out 'postgres', 'pg_lsclusters -h', 0, qr/$cur.*online/, 
393
553
        "Old $cur cluster is online";