Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Following on from this prior question, I'm trying to export a database from one server and put it on another using phpPgAdmin. My process is like this:

  1. select the database in server 1 and hit the export button
  2. select "data and structure and select the option in the dropdown "copy"
  3. download
  4. create the a database of the same name in server 2 with the same name as the database from server 1
  5. select that database, open up the SQL pane, and paste the SQL code I downloaded from server 1
  6. Execute

That's when I get the error:

ERROR:  syntax error at or near "OWNED"
LINE 73: ALTER SEQUENCE address_customer_id_seq OWNED BY address.cust...

Line 73 in its entirety is:

 ALTER SEQUENCE address_customer_id_seq OWNED BY address.customer_id;

I've read here that it may be because I've have slightly different versions of PostgreSQL on my two servers. So I checked with the server tech, who said that, yes, there was that issue. So he upgraded server 2. I'm getting the same error however.

Any idea what could be going on?

share|improve this question

migrated from serverfault.com May 10 '13 at 11:29

This question came from our site for system and network administrators.

    
You seem to have omitted the new version of the upgraded server, but I strongly suspect it's still on 8.1 since the ALTER SEQUENCE ... OWNED BY clause was added in 8.2 (see postgresql.org/docs/8.2/static/sql-altersequence.html and compare to postgresql.org/docs/8.1/static/sql-altersequence.html). You really need to understand that 8.4 and 8.1 aren't slightly different versions, they're massively different. Yes, I know the version numbering is stupid :S. See the version policy document linked in the prior answer. –  Craig Ringer May 10 '13 at 4:48
    
Important context in this earlier question: stackoverflow.com/questions/16473630/… –  Craig Ringer May 10 '13 at 4:54
    
@CraigRinger - that sounds like an answer to me –  Mark Henderson May 10 '13 at 11:28
    
@MarkHenderson Close enough, anyway. –  Craig Ringer May 10 '13 at 14:40

1 Answer 1

up vote 2 down vote accepted

You seem to have omitted the new version of the upgraded server, but I strongly suspect it's still on 8.1 since the ALTER SEQUENCE ... OWNED BY clause was added in 8.2 (Compare ALTER SEQUENCE docs on 8.2 to ALTER SEQUENCE docs on 8.1).

You really need to understand that 8.4 and 8.1 aren't slightly different versions, they're massively different. It's like saying that Windows Vista and Windows 7 are "slightly different" versions because they're Windows versions 6.0 and 6.1 respectively. Or that Mac OS X 10.4 and 10.7 are "slightly different"... when they're more incompatible than not.

Yes, I know the version numbering in PostgreSQL is stupid; it's a historical oddity we seem to be stuck with despite periodic attempts to change it. See the version policy document linked in the prior answer for more information about what the versioning means, and read the release notes for a better understanding.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.