8

How to drop not null constraint that will work both in PostgreSql and HSQL?

I'm using: ALTER TABLE tablename ALTER COLUMN columnname DROP NOT NULL; But it's not working in HSQL.

This column was created: columnname TEXT NOT NULL,

kostepanych
  • 2,229
  • 9
  • 32
  • 47
  • See the manual: http://hsqldb.org/doc/2.0/guide/databaseobjects-chapt.html#N11364 –  Mar 24 '16 at 13:43
  • Possible duplicate of [How to change a PG column to NULLABLE TRUE?](https://stackoverflow.com/questions/4812933/how-to-change-a-pg-column-to-nullable-true) – Evan Carroll May 04 '18 at 00:45

1 Answers1

5

The current HSQLDB syntax is: ALTER TABLE tablename ALTER COLUMN columnname SET NULL But the PostgreSQL syntax will be supported in HSQLDB version 2.3.4 release.

fredt
  • 24,044
  • 3
  • 40
  • 61