Comments (5)
Okay this is a pg_tle
bug. You can reproduce it by running the following pgtle
api calls:
-- install version 1.0 of an extension
SELECT pgtle.install_extension
(
'test123',
'1.0',
'Test TLE Functions',
$_pgtle_$
CREATE OR REPLACE FUNCTION test123_func()
RETURNS INT AS $$
(
SELECT 10
)$$ LANGUAGE sql;
$_pgtle_$
);
-- create update path to 1.1
SELECT pgtle.install_update_path
(
'test123',
'1.0',
'1.1',
$_pgtle_$
CREATE OR REPLACE FUNCTION test123_func()
RETURNS INT AS $$
(
SELECT 11
)$$ LANGUAGE sql;
$_pgtle_$
);
--confirm that the upgrade paths are registered
select * from pgtle.extension_update_paths('test123');
-- create extension should pass but it fails with the error:
-- ERROR: could not find sql function "test123--1.1.sql" for extension test123 in schema pgtle
--
-- SQL state: XX000
CREATE EXTENSION test123 version '1.1';
I couldn't reproduce it earlier because I was on the latest dev version of pg_tle
. We plan to update pg_tle
to the latest version on our platform soon but until then dbdev TLEs will have to use a test123--1.1.sql
file as well. If you have published a basejump-basejump_core
without the basejump-basejump_core--2.0.1.sql
, just add this file and run dbdev publish
again and that should fix it.
from dbdev.
Hey @tiniscule,
How did you install basejump_core
? Did you use the dbdev
cli's install
command? If yes, was the dbdev
version older than 0.1.4
? There was a fix in 0.1.4
about update paths not being installed.
To debug, you can see which update paths are available with select * from pgtle.extension_update_paths('basejump_core');
command. This will return a source
, target
and a path
column. If you see a source
= 2.0.1
a target
= 2.1.0
and a path
= 2.0.1--2.1.0
it means the update path is available and you should be able to create the extension. if the path
is null or the entire row is missing then it won't work.
from dbdev.
Thanks for the quick response @imor , yes it was installed with the dbdev local command.
dbdev version: 0.1.5;
result of extension_update_paths query:
That second one seems odd, is that to be expected? here's the file structure:
from dbdev.
That second one seems odd, is that to be expected?
Yes, that is ok. Postgres doesn't really understand the contents of a version. They are just treated a opaque strings. So it doesn't know which version is greater, it just lists all combinations of source and target.
That's really weird, the data you have shared looks completely fine to me. The create extension "basejump_core" version '2.1.0';
command should have caused pg_tle
to first run basejump_core--2.0.1.sql
and then run basejump_core--2.0.1--2.1.0.sql
to create the extension.
To further debug it can you please share:
- The
pg_tle
extension version you have installed. You can check it by runningselect extversion from pg_extension where extname = 'pg_tle';
- The code for
basejump_core
from a branch or tag with exact files above. - Check which
.sql
and.control
functions are present by runningselect * from pg_proc where proname like '%basejump_core%';
.
from dbdev.
pg_tle version: 1.0.4
Code: usebasejump/basejump#57
functions:
from dbdev.
Related Issues (20)
- Link to package author documentation in README/website
- Enable custom SMTP
- Unable to publish second version of an extension HOT 1
- Design a way to update the readme without having to push a new version HOT 5
- Prevent TLEs from referencing other TLEs in `requires` HOT 1
- docs: add some docs describing how to use "dbdev install" via the CLI
- feat: add a "dbdev create" command HOT 2
- docs: add some docs showing how to update the CLI HOT 2
- Add metadata field for home repository so users can contribute
- `dbdev ls --connection=xxxx` command to list installed TLEs
- Use default_version information from control file
- How do I un-publish a TLE? HOT 1
- Install script fails on pg_tle extension HOT 2
- How are TLE migration handled HOT 1
- `public.packages` view should take `app.package_upgrades` into account as well for its latest_version column.
- docs: support github markdown HOT 2
- Improve documentation about TLE upgrades HOT 5
- Applying local migration - ERROR: extension "supabase-dbdev" is not available (SQLSTATE 0A000) HOT 9
- Naming Fail :| HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbdev.