[ic] Porting access Table to Postgres

Brian Rogers brian at groxis.com
Wed Dec 17 21:12:22 EST 2003


Hi Interchangers,

I'm trying to port my Admin UI access table from dbm to Postgres because
I've been having problems with my access.gdbm file getting corrupted.

In catroot/dbconf/psql/ I removed access.dbm and created this access.pgsql
file (based on the structure of the original access.asc file):

Database access access.txt  __SQLDSN__

ifdef SQLUSER
Database access USER        __SQLUSER__
endif

ifdef SQLPASS
Database access PASS        __SQLPASS__
endif

Database  access     KEY          username
Database  access     COLUMN_DEF   "username = VARCHAR(32) NOT NULL PRIMARY
KEY"
Database  access     COLUMN_DEF   "password = VARCHAR(64)"
Database  access     COLUMN_DEF   "name = VARCHAR(128)"
Database  access     COLUMN_DEF   "last_login = VARCHAR(16)"
Database  access     COLUMN_DEF   "super = VARCHAR(16)"
Database  access     COLUMN_DEF   "yes_tables = TEXT"
Database  access     COLUMN_DEF   "no_tables = TEXT"
Database  access     COLUMN_DEF   "upload = TEXT"
Database  access     COLUMN_DEF   "acl = TEXT"
Database  access     COLUMN_DEF   "export = TEXT"
Database  access     COLUMN_DEF   "edit = TEXT"
Database  access     COLUMN_DEF   "pages = TEXT"
Database  access     COLUMN_DEF   "files = TEXT"
Database  access     COLUMN_DEF   "config = TEXT"
Database  access     COLUMN_DEF   "reconfig = TEXT"
Database  access     COLUMN_DEF   "groups = TEXT"
Database  access     COLUMN_DEF   "meta = TEXT"
Database  access     COLUMN_DEF   "no_functions = TEXT"
Database  access     COLUMN_DEF   "yes_functions = TEXT"
Database  access     COLUMN_DEF   "table_control = TEXT"
Database  access     COLUMN_DEF   "personal_css = VARCHAR(128)"


The table builds fine when interchange is restarted:


NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 'access_pkey'
for table 'access'
table access created: create table access (
username VARCHAR(32) NOT NULL PRIMARY KEY,
password VARCHAR(64),
name VARCHAR(128),
last_login VARCHAR(16),
super VARCHAR(16),
yes_tables TEXT,
no_tables TEXT,
upload TEXT,
acl TEXT,
export TEXT,
edit TEXT,
pages TEXT,
files TEXT,
config TEXT,
reconfig TEXT,
groups TEXT,
meta TEXT,
no_functions TEXT,
yes_functions TEXT,
table_control TEXT,
personal_css VARCHAR(128)
)

done.


and I can log in to the Admin UI as my superuser.

However, when I test the table by trying to change my password through the
Admin UI, none of my changes take.  The UI doesn't report an error, but I
get errors like these in my catalog error.log:


192.168.0.152 gIapbYXn:192.168.0.152 - [17/December/2003:15:06:01 -0800]
blah /service/blah/process.html Attempted database operation without table,
fields, or key.
> Table: ''
> Fields:''
> Key:   ''
>

I looked at the Data.pm perl module and found that this error is due to lack
of mv_data_table and mv_data_key values, so I passed them in explicitly with
hidden form inputs.  Then I got this error:

192.168.0.152 gIapbYXn:192.168.0.152 - [17/December/2003:15:09:43 -0800]
blah /service/blah/process.html No key 'username' found for
function='update' table='access'

So I passed in a value for username, too.

That got rid of all the errors, but my password change does not take, and I
can only log back in with the old password.

When I try to edit other fields in the access table through the 'Tables' tab
in the Admin UI, I get no errors, but the changes are not accepted.  The
last_login field for my superuser is also not updated when I logged in.

Am I missing something?  I've built other Interchange tables from scratch
with no problem, but porting this table from dbm seems to be breaking
existing code in the Admin UI.

Any help would be greatly appeciated.

Thanks!


---------------------
Brian Rogers
Software Developer
Groxis, Inc.
415.331.0550 x109
www.groxis.com





More information about the interchange-users mailing list