postgresql_slashcode_porting_problems

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.





Subject: [Slashcode] postgres and slash
From: Doug Alcorn <doug@lathi.net>
Date: 25 May 2000 02:06:57 -0400


I have seen the posts about slash currently not being database
independant.  However, I am fairly good perl programmer and a fairly
competent SQL programmer (although I haven't done the two together
much).  I would like to help get slash up and running with Postgres
(at least).  I'm not sure the best way to start.  I haven't ever run
slash before.

I have started setting up a slash site using my postgres database and
slash 1.0.3.  I have updated the schema file so that it is compatible
with slash.  There were a couple of changes in column names due to
reserved words "copy" and "offset".  I left the script variables names
what they were, but updated the sql so that it references columns
authors_copy and tzcodes_offset (I wasn't sure what would be better to
call the columns). I have also loaded the DBD::Pg module.

/etc/rc.d/..../slashd tries to start up.  In fact, it reports that it
started "ok".  I think this message is somewhat bogus.  After some
churning, I get sql statements printed to my terminal.  The first time
I tried starting slash, I got this:

SELECT alttext,image,width,height,newstories.tid FROM
newstories,topics WHERE newstories.tid=topics.tid AND displaystatus =
0 AND writestatus >= 0 AND time < now() ORDER BY time DESC

and the second time it was:

SELECT * FROM stories WHERE sid='00/01/25/1430236' 
SELECT sid,section    FROM stories   WHERE writestatus=5 

I guess I expected to get more error information. --time passes-- OK,
I'm really tired.  I found the log file and there is some stuff in
there to go on.  I will work on it more later.  If you guys have some
words of wisdom I would appreciate it.

===

Subject: Re: [Slashcode] postgres and slash
From: Chris Nandor <pudge@pobox.com>
Date: Thu, 25 May 2000 11:14:18 -0400


At 2.06 -0400 2000.05.25, Doug Alcorn wrote:
>I have seen the posts about slash currently not being database
>independant.  However, I am fairly good perl programmer and a fairly
>competent SQL programmer (although I haven't done the two together
>much).  I would like to help get slash up and running with Postgres
>(at least).  I'm not sure the best way to start.  I haven't ever run
>slash before.

Note the article on Slashcode.com.

    http://slashcode.com/article.pl?sid=00/05/18/2128222

We discuss the "bender" branch which is the development branch on CVS.  If
you want to help, keep up to date with that branch and work with it.  We
might set up another mailing list (or use this one) for discussion of
database independence issues.


===

Subject: Re: [Slashcode] postgres and slash
From: Doug Alcorn <doug@lathi.net>
Date: 25 May 2000 14:42:57 -0400


Doug Alcorn <doug@lathi.net> writes:

> I have started setting up a slash site using my postgres database and
> slash 1.0.3.  I have updated the schema file so that it is compatible
> with slash.  There were a couple of changes in column names due to
> reserved words "copy" and "offset".  I left the script variables names
> what they were, but updated the sql so that it references columns
> authors_copy and tzcodes_offset (I wasn't sure what would be better to
> call the columns). I have also loaded the DBD::Pg module.
> 

OK, I just got bender from cvs.  I wanted to make a couple of
recommendations for the slashschema_create.sql that I found while
getting this schema to load in PostgreSQL.

 - Pgsql can't support specifying the display precision of
 integers at table creation time.  Things like int(11) and int(1)
 aren't allowed.  I'm not a pgsql guru and don't know how to specify
 the display format for all time on a column.  I'm not sure it can be
 done.

 pgsql does support the numeric column type.  This allows specifying a
 precision and scale, but not a display format.  I tried using a
 numeric column type with the precision set to what the schema
 specified.  This blew up when I did the actual data load.  There were
 numbers that were out of range.

 - pgsql doesn't specify the secondary keys like mysql.  It requires a
 seperate sql command: create index idx_name on table_name (col, ...).

 - This brings up a seperate subltle point, indexes have database wide
 names in pgsql.  I don't think this has any affect on the code; you
 don't reference indexes by name do you?  It's just that every index
 in the database has to have a unique name.

 - '0000-00-00' is not a valid date format for pgsql.  To get my data
 load, I just changed it to my birthday, '1971-01-15'.  What is
 invalid is that pgsql doesn't understand year 0000, month 00, and day
 00.
 
 - pgslq doesn't support comments with '#'.  Single line comments use
 '--' and multi-line comments use the C-sytle '/* ... */'.

I'm sure many of you are already aware of these differences.  I only
re-iterate them here because bender is supposed to be moving to
database independance, isn't it?  I'm not even sure what the best way
to fix the problems.  Maybe using something like lexx and then

===


the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu