Skip to content

Conversation

@anton-schieber
Copy link
Contributor

Add support for the apache and community editions of timescaledb in the hypertable generator.

Resolves #12

@anton-schieber anton-schieber force-pushed the feature/edition-support branch 4 times, most recently from 606eec7 to 91d6cf0 Compare November 26, 2025 22:30
@anton-schieber
Copy link
Contributor Author

@sebastian-ederer, can you lend a hand with these last few failing tests?

@sebastian-ederer
Copy link
Contributor

@anton-schieber Of course, I'll have a look at it tomorrow.

Add support for the apache and community editions of timescaledb in the
hypertable generator.
The checks will now account for editions by checking the current version.
@anton-schieber anton-schieber force-pushed the feature/edition-support branch from 91d6cf0 to ce02d7d Compare November 27, 2025 09:44
…mdscale#12)

Use EXECUTE statements inside DO $$ blocks to fix PL/pgSQL limitations where SELECT statements cannot return data without a destination.

   - Wrap Community-only features in runtime license check
   - Escape single quotes for EXECUTE string literals
   - Move chunk_time_interval into create_hypertable() parameters
   - Update warning message to reference Apache Edition
@sebastian-ederer
Copy link
Contributor

@anton-schieber I fixed all tests and resolved the issues.

I had to update the expected SQL for one test, but all other tests failed because of this:

In WrapCommunityFeatures() the SQL for statements were just being appended. However, PL/pgSQL doesn't allow bare SELECT statements that return data - they must either use PERFORM or EXECUTE. I chose EXECUTE, because PERFORM also has some limitations and EXECUTE was made for dynamic SQL (see stackoverflow).

I also changed the RAISE WARNING because I think the enterprise edition is the one from TigerData and Apache Edition would be more fitting. Please correct me if that was wrong, but looking at the code this seemed logical to me.

// Before
sb.AppendLine("        RAISE WARNING 'Skipping Community Edition features (compression, chunk skipping) - not available in Enterprise Edition';");

// After
sb.AppendLine("        RAISE WARNING 'Skipping Community Edition features (compression, chunk skipping) - not available in Apache Edition';");

P.S. I've abused your branch for a small refactoring to use explicit types instead of var where I forgot to change it, lol.

@sebastian-ederer sebastian-ederer self-requested a review November 27, 2025 19:11
Copy link
Contributor

@sebastian-ederer sebastian-ederer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sebastian-ederer sebastian-ederer merged commit c80e693 into cmdscale:main Nov 27, 2025
2 checks passed
@anton-schieber
Copy link
Contributor Author

Awesome, thanks for that
Could you tag a new release? Gonna do some testing on the new stuff today

@sebastian-ederer
Copy link
Contributor

Yes, I just started the pipeline. Wait for a few minutes then it should've run through. Maybe it takes another couple of minutes until NuGet indexes the new version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TimescaleDB - Community v Apache

2 participants