[YSQL] "create table" not supported in a "template" database #15221
Labels
area/ysql
Yugabyte SQL (YSQL)
kind/enhancement
This is an enhancement of an existing feature
priority/medium
Medium priority issue
Jira Link: DB-4400
Description
This is YB-2.15.3.2.
The attempt to create either a regular table or a temporary table in a "template" database causes this warning:
and the hint says "raise a GitHub issue". Notice that this is a warning and not an error—and the attempt does actually create a table. But the result isn't trustworthy.
Note: The warning's wording is, in general, too narrow. Vanilla PG lets you create template databases with whatever names you want. However, through YB-2.15.3.2 you cannot do this. The attempt causes "Value other than default or false for is_template option is not yet supported". This shows that the "template" functionality is far from complete.
Because the attempt actually does create a table, I went ahead and populated a test table. But the attempt to create a new database with reference to my customized template caused its own errors.
Use case
I want to make some data available in all user-created databases. (It happens to be data from the Wikipedia page "List of tz database time zones".) The larger purpose is described in the YSQL doc in the section "The extended_timezone_names view".
The details don't matter. It's just an example of a completely ordinary template customization use case: make any kind of reference data automatically available in any database.
Further, the raw data from the Wikipedia page needs some post-processing. So it's natural to load it (with the "\copy" metacommand) into a temporary staging table and to use this as the source for the permanent target table. This is a classic use case for a temporary table—and it works fine (in a template database) in vanilla PG Version 11. So when this limitation is removed, it's essential that temporary tables are supported in a template database too.
The text was updated successfully, but these errors were encountered: