Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Missing LSQL feature, when using PostgreSQL database

Quote Reply
Missing LSQL feature, when using PostgreSQL database
The bug appears, when Links SQL is used together with PostgreSQL database.
(Bug appeared under following versions: Links SQL version 2.1.2, PostgreSQL 7.2.1)
An error appears, when a new field is added manually by the user, to Category table.

The error is the following:
Code:
Unable to add column 'DirName'. Reason: Failed to execute query:
'ALTER TABLE lsql_Category ADD DirName VARCHAR(255) NOT NULL'
Reason: ERROR: Adding NOT NULL columns is not implemented.

I digged a bit on the net, and seems there were no NOT NULL feature implemented into ALTER TABLE, before PostgreSQL version 7.3.

Below 7.3 NOT NULL is not implemented in ALTER TABLE.
From 7.3 and above, it is implemented using the following syntax:
Code:
ALTER TABLE tablename ALTER COLUMN columnname SET NOT NULL;
(Note the SET command)

Well, it is not a problem, but this should be threated correctly by PostgreSQL DBD driver in Links SQL. Unfortunately nor the version difference, nor the SET command is not implemented. So the bug is in GT/SQL/Driver/PG.pm.

URLs related to this problem:
http://archives.postgresql.org/...2002-10/msg00249.php
http://developer.postgresql.org/...tgres/ddl-alter.html

EDIT: I also found a very useful page, which gives useful info about updating PostgreSQL tables:
http://techdocs.postgresql.org/.../updatingcolumns.php

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: Jan 20, 2003, 11:22 AM
Quote Reply
Re: [webmaster33] Missing LSQL feature, when using PostgreSQL database In reply to
Thanks! As a workaround, you can add the column as null, and then edit it and change it to not null afterwards (but use Links SQL 2.1.2 as it fixes some postgres table alter issues).

Cheers,

Alex
--
Gossamer Threads Inc.