Re: [h2] Discoverability of CHECK constraints in INFORMATION_SCHEMA

2013-06-19 Thread Lukas Eder
2013/6/18 Noel Grandin noelgran...@gmail.com On 2013-06-09 13:43, Lukas Eder wrote: Is this the intended behaviour? In my opinion, both constraints should appear in the constraints view, though. Note, this is how I would query for CHECK constraints in the SQL standard INFORMATION_SCHEMA

Re: [h2] Discoverability of CHECK constraints in INFORMATION_SCHEMA

2013-06-19 Thread Noel Grandin
On 2013-06-19 08:23, Lukas Eder wrote: Are there any plans to move towards semantic versioning (http://semver.org) with H2? The current versioning scheme doesn't formally allow to remove such backwards-compatibility flags again. With semantic versioning, I think it would be OK to change the

[h2] Problem with conditional COUNT aggregate

2013-06-19 Thread Uli
Hi, after reading the documentation about the COUNT aggregate function ( http://www.h2database.com/html/functions.html#count) I would expect that it is possible to have a conditional COUNT. But it does not seem to work as the test program below shows. It creates a table with two colums t1 and

Re: [h2] Problem with conditional COUNT

2013-06-19 Thread Noel Grandin
No, sorry, that's not valid SQL at all. They have to be executed as separate statements. SELECT COUNT(*) FROM TEST WHERE (t2-t1) 1000) SELECT COUNT(*) FROM TEST WHERE (t2-t1) = 1000) SELECT COUNT(*) FROM TEST or like this, if you really needed the efficiency: SELECT ((t2-t1) 1000), COUNT(*)

Re: [h2] Problem with conditional COUNT

2013-06-19 Thread Uli
Thanks! For the sake of completeness: after carefully rereading the documentation I found a solution to get the values in one query with one resulting row. The documentation says that COUNT counts all *non-NULL* values. When combining the boolean expression with CASEWHEN it is possible to use

Re: [h2] Discoverability of CHECK constraints in INFORMATION_SCHEMA

2013-06-19 Thread Lukas Eder
2013/6/19 Noel Grandin noelgran...@gmail.com On 2013-06-19 08:23, Lukas Eder wrote: Are there any plans to move towards semantic versioning ( http://semver.org) with H2? The current versioning scheme doesn't formally allow to remove such backwards-compatibility flags again. With semantic

[h2] Using functions inside a UNIQUE constraint?

2013-06-19 Thread Gili
Hi, Is it possible to invoke functions such as LEAST or GREATEST from within a UNIQUE constraint? I am having problems trying to implement http://stackoverflow.com/a/16867094/14731 I invoked: CREATE TABLE connections (id IDENTITY, from_participant_id BIGINT NOT NULL, to_participant_id BIGINT

[h2] Re: Using functions inside a UNIQUE constraint?

2013-06-19 Thread Gili
Answering my own question: you need to use computed columns: http://www.h2database.com/html/features.html#computed_columns The updated SQL looks like this: CREATE TABLE connections (id IDENTITY, from_participant_id BIGINT NOT NULL, to_participant_id BIGINT NOT NULL, least_participant_id BIGINT