[ic] customizing IC's default SQL database tables

Gabe Burt interchange-users@lists.akopia.com
Fri May 25 14:38:00 2001


Dan,

I've tried doing what you suggested as far as getting customized
postgres tables up and running, but am having some trouble. Maybe
you'll want to try to answer this via e-mail, but if you have the time
I think it would be very helpful for me if we could meet in
#interchange sometime.

So far I've created a SQL file with the alter database commands in it
(it also adds another table that I need) and have made those changes in
the respective .pgsql files. I have touch'd the respective .sql files
in the /products directory for each table I modified in the
dbconf/pgsql directory.

But when I try to load interchange with a catalog made from this
modified construct template, I get this error:

Low traffic settings.
Calling UI....
...UI is loaded....
Interchange V4.6.5
Configuring catalog testcat...Using PostgreSQL,
DSN=dbi:Pg:dbname=nebag.
testcat config error: ERROR: Relation 'orderline' does not exist

testcat: error in configuration. Skipping.
testcat: config error. Skipping.
Interchange server started in INET mode(s) (process id 26305)

At this point I haven't loaded my custom SQL file - should I? From what
I can tell there are not tables in the database to alter, so I don't
think I should yet.

I'm not sure where to do from here. I think the crux of my problem is
that I don't understand when and from what interchange creates the
database tables for a catalog. When I was using the unmodified
construct template, it seemed to create them when I started interchange
for the first time.

Would you happen to have the any relevant documentation bookmarked or
something? I've looked through developer.akopia.com before, and have
found a lot of useful information, but nothing about doing something
like this.

Thanks for being patient with me.

Gabe

--- Dan B <db@cyclonehq.dnsalias.net> wrote:
> Gabe,
> 
> At 03:46 PM 5/17/2001 -0700, you wrote:
> >Thanks a lot for the advice, Dan. Two more things - what about
> making
> >new database tables?
> 
> Same procedure (copied below), except you copy an existing .pgsql and
> edit 
> it, instead of just adding one column.  Also you need to first CREATE
> TABLE 
> of course, (instead of ALTER TABLE), and pgsql has great
> documentation 
> (like a free book online in PDF).
> 
> >What about changing the default tables?
> 
> You should be able to make any changes that you are capable of with
> pgsql, 
> and as long as those changes are reflected in the respective .pgsql
> file, 
> Interchange will be fine.
> 
> >Can I just
> >edit the .pgsql files?
> 
> Yep.
> 
> >Also, should I delete the .txt files in
> >/products?
> 
> It's not really necessary to delete them.  As long as there is a .sql
> file 
> (any length) then IC will utilize the SQL database instead of the
> text.
> 
> >And one more thing - how much can I change the databases
> >without them breaking on me? I would like to implement table key
> ID's
> >using database sequences.
> 
> Do you mean the SERIAL datatype in pgsql?  Or using pgsql's record
> OID?
> 
> Either way, I don't know if IC would stand in your way or not, but I
> do 
> know that 4.7.x has great support for autonumbering, which might be a
> 
> better solution.  (check out the latest "WHATSNEW" file for 4.7).
> 
> >Okay, I lied, one more thing. How did you
> >figure out how to do this? I appreciate your help.
> 
> I think it's in the docs somewhere (I read them through a few times
> for 
> good measure), but you can really tell how I "figured this out" by
> looking 
> up my name in the mailing list.  :-)  I've been getting less and less
> 
> clueless since August.
> 
> Enjoy Interchange, Gabe.  It's among the few and proud with such good
> DB 
> support.
> 
> -Dan B.
> 
> > >
> > > 1. start with default template construct
> > > 2. add one field to database
> > >          psql -c "ALTER TABLE products ADD COLUMN foo
> VARCHAR(64);"
> > > 3. add said field to dbconf/pgsql/products.pgsql
> > > 4. make sure you're not importing from text db
> > >          touch products/products.sql
> > > 5. restart interchange
> > >
> > > You can often skip step 2 if you replace step 4 with "add another
> > > column to
> > > products/products.txt".
> > >
> > > HTH,
> > >
> > > Dan Browning, Cyclone Computer Systems, danb@cyclonecomputers.com
> 
> Dan Browning, Cyclone Computer Systems, danb@cyclonecomputers.com
> 
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/