Обсуждение: Alter Table Error
Hello I keep receiving a parse error when trying to add a foreign key constraint using alter table. I've searched thru some of the archives and the web and have found numerous complaints about the same problem but have not found a solution or explanation. Anyone have a clue how to solve or circumvent this problem? Thanks -bill
I'm using pg_dump to port a database from one server to another, and I've found that the max_value of several sequences are 9223372036854775807 (type bigint), but most of the sequences' max_values are 2147483647 (also bigint, but not so big...). The larger value is causing errors when I try to import the database. Does this have to do with the OS or the postgres version? The source database is version 7.2.1, and the destination is 7.1.3. Did 7.2 raise the upper limit of bigint? The postgres docs state: " The bigint type may not function correctly on all platforms, since it relies on compiler support for eight-byte integers. On a machine without such support, bigint acts the same as integer (but still takes up eight bytes of storage). However, we are not aware of any reasonable platform where this is actually the case. " I'm not sure whether this applies to 7.1.3. My compiler is gcc 2.95, on kernel 2.4.17... This seems "reasonable" enough... :) Thanks, Garo =-=-==-=-=-== Xapnet Internet Solutions 1501 Powell St., Suite N Emeryville, CA 94608 Tel - (510) 655-9771 Fax - (510) 655-9775 Web - http://www.xapnet.com
Garo Hussenjian <garo@xapnet.com> writes: > I'm using pg_dump to port a database from one server to another, and I've > found that the max_value of several sequences are 9223372036854775807 (type > bigint), but most of the sequences' max_values are 2147483647 (also bigint, > but not so big...). The larger value is causing errors when I try to import > the database. > Does this have to do with the OS or the postgres version? The source > database is version 7.2.1, and the destination is 7.1.3. Did 7.2 raise the > upper limit of bigint? No, but sequences were based on int before 7.2. You seem to have a mix of sequences dumped-and-reloaded from 7.1 and sequences made natively in 7.2. If you want to load this dump in 7.1, I'd recommend just editing out the clauses that specify the sequence upper limit --- these are really all "default" anyway. As a general rule, back-porting PG databases to older versions is a recipe for headaches. My real recommendation is to update the destination machine to 7.2.2 ;-) regards, tom lane