pg_upgradecluster fails with an SQL syntax error

Bug #1574978 reported by Marius Gedminas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
postgresql-common (Ubuntu)
New
Undecided
Unassigned

Bug Description

I'm trying to upgrade my PostgreSQL 8.4 cluster on Ubuntu 12.04 LTS to PostgreSQL 9.1, by running:

    pg_dropcluster 9.1 main --stop
    pg_upgradecluster 8.4 main

This fails with an SQL syntax error because apparently one of the tables in one of the databases has a column named "new" that ought to be quoted appropriately in the generated dump file:

Stopping old cluster...
Disabling connections to the old cluster during upgrade...
Restarting old cluster with restricted connections...
Creating new cluster (configuration: /etc/postgresql/9.1/main, data: /var/lib/postgresql/9.1/main)...
Moving configuration file /var/lib/postgresql/9.1/main/postgresql.conf to /etc/postgresql/9.1/main...
Moving configuration file /var/lib/postgresql/9.1/main/pg_hba.conf to /etc/postgresql/9.1/main...
Moving configuration file /var/lib/postgresql/9.1/main/pg_ident.conf to /etc/postgresql/9.1/main...
Configuring postgresql.conf to use port 5433...
Disabling connections to the new cluster during upgrade...
Roles, databases, schemas, ACLs...
Fixing hardcoded library paths for stored procedures...
Upgrading database pov3...
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: syntax error at or near "new"
LINE 1: ...verse, adjusted_journal_id, adjusted_currency_id, new, relat...
                                                             ^
pg_dump: The command was: COPY public.account_bank_statement_line (id, create_uid, create_date, write_date, write_uid, reconcile_id, partner_id, type, account_id, note, date, ref, statement_id, adjusted_move_line_id, reverse, adjusted_journal_id, adjusted_currency_id, new, related_statement_line_id, payment_mode_id, payment_order_id, payment_line_id, state, amount, operation_id, adjusted_with_move_line_id, advance_invoice_id, payroll_reconciled, payroll_reconcile_id, payroll_period_id, payment_code, name) TO stdout;
pg_restore: [custom archiver] unexpected end of file
Re-enabling connections to the old cluster...
Re-enabling connections to the new cluster...
Error during cluster dumping, removing new cluster

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: postgresql-common 129ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-101.141-generic 3.2.76
Uname: Linux 3.2.0-101-generic x86_64
ApportVersion: 2.0.1-0ubuntu17.13
Architecture: amd64
Date: Tue Apr 26 09:50:03 2016
MarkForUpload: True
PackageArchitecture: all
ProcEnviron:
 LC_CTYPE=lt_LT.UTF-8
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: postgresql-common
UpgradeStatus: Upgraded to precise on 2012-07-31 (1364 days ago)

Revision history for this message
Marius Gedminas (mgedmin) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.