[ic] PostgreSQL AUTO_SEQUENCE

Greg greg at valuemedia.com
Tue Aug 3 10:45:53 EDT 2004


Grant wrote:

>I set up MySQL with IC 5.0 very easily, but setting up
>PostgreSQL on 5.2 has been more difficult.  The last
>hump I need to get over is the AUTO_SEQUENCE
>functionality for my order_items table.
>
>Mike suggests the following:
>
>Database order_items COLUMN_DEF "id=int default
>nextval('order_items_sequence'::text)"
>
>here:
>
>http://www.icdevgroup.org/pipermail/interchange-users/2004-July/040109.html
>
>and I've read the PostgreSQL CREATE SEQUENCE docs
>here:
>
>http://developer.postgresql.org/docs/postgres/sql-createsequence.html
>
>which caused me to try adding:
>
>Database order_items CREATE_SEQUENCE
>order_items_sequence START 2000
>
>in addition to Mike's suggestion.  I also have:
>
>Database order_items AUTO_SEQUENCE 1
>
>in my catalog.cfg, but I can't seem to get IC to
>AUTO_SEQUENCE properly.  I get errors like this in my
>error.log:
>
>//admin/flex_editor DBD::Pg::st execute failed: ERROR:
> Relation "1" does not exist at
>/usr/local/interchange/lib/Vend/Table/DBI.pm line 942.
>
>Does anyone have any tips for me?
>  
>
Did you actually create the sequence in your database?

CREATE SEQUENCE order_items_sequence START 2000;

Make sure that it is actually in your database and functioning.
In your database try something like:

	
SELECT nextval('order_items_sequence');

Make sure you get something returned.
The error you got seems to indicate its not finding the sequence.

Greg

>- Grant
>
>
>		
>__________________________________
>Do you Yahoo!?
>New and Improved Yahoo! Mail - Send 10MB messages!
>http://promotions.yahoo.com/new_mail 
>_______________________________________________
>interchange-users mailing list
>interchange-users at icdevgroup.org
>http://www.icdevgroup.org/mailman/listinfo/interchange-users
>
>
>  
>


-- 
Greg Hanson
Perusion
1506 E Gilbert Ave
Coeur d'Alene, ID 83815

Email		greg at perusion.com
Phone		208-667-2442
Toll Free	800-949-1889
Fax		775-256-2231
Web		http://www.perusion.com



More information about the interchange-users mailing list