-
-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop CockroachDB compatibility #1852
Comments
pgModeler relies on original PostgreSQL system catalogs (tables, views, functions) to run the database reverse engineering. That's why I don't guarantee that the mentioned process will work on the forks of the RDBMS. I don't know CrockroachDB but obviously, it lacks some needed pieces so the import/diff features work without errors. If your problem is only the absence of
By:
Note that a non-empty value is needed for the field |
Ok, thanks for looking into it! |
I tried with the suggested solution, then the diff process seemed to work for longer, but then there was a segmentation fault. How can I find out where the segfault was? |
Segmentation fault means bug. I need to debug pgModeler running the diff in a copy of your database and see where it is crashing. :) Or if you can create a small sample model/dump where the crash happens I can use it too. |
Here are the steps to reproduce:
Here is the model I used: I can send you the dump too if you tell me where to look for it, I'm using Linux Mint. |
I think it dumped because the I tried another model without partitioning then the diff progress dialogue came up and showed the progress, it went through all partitions also the system partitions, then right at the end it dumped. I then did a partial diff only on one schema (with do not drop missing objects) and then the diff process successfully completed! 👍 The create role statement is incomplete but the rest of the statements are correct. The reason that the create role statement is incomplete may be because I did not give the role any privileges in the pgModeler model. Here is the model for which a partial diff only on schema Here is the complete generated diff: -- Diff code generated with pgModeler (PostgreSQL Database Modeler)
-- pgModeler version: 1.1.0
-- Diff date: 2024-02-23 06:44:24
-- Source model: new_database
-- Database: defaultdb
-- PostgreSQL version: 13.0
-- [ Diff summary ]
-- Dropped objects: 0
-- Created objects: 3
-- Changed objects: 0
SET search_path=public,pg_catalog,test4;
-- ddl-end --
-- [ Created objects ] --
-- object: cdbdba7105 | type: ROLE --
-- DROP ROLE IF EXISTS cdbdba7105;
CREATE ROLE cdbdba7105 WITH ;
-- ddl-end --
-- object: test4 | type: SCHEMA --
-- DROP SCHEMA IF EXISTS test4 CASCADE;
CREATE SCHEMA test4;
-- ddl-end --
ALTER SCHEMA test4 OWNER TO cdbdba7105;
-- ddl-end --
-- object: test4.test4 | type: TABLE --
-- DROP TABLE IF EXISTS test4.test4 CASCADE;
CREATE TABLE test4.test4 (
id int8,
partition text,
created_at timestamptz DEFAULT now()
);
-- ddl-end --
ALTER TABLE test4.test4 OWNER TO cdbdba7105;
-- ddl-end -- |
Feature description
This feature request is to develop the capability in pgModeler to import and diff CockroachDB databases. Since CockroachDB is supposed to be PostgreSQL compliant there may be very little work involved in making pgModeler CochroachDB compatible. By making pgModeler CockroachDB compatible a whole new market would be opened up for this tool.
CockroachDB is built on the premise of having an interface compatible with PostgreSQL. However, there are some features in PostgreSQL which do not (yet) exist in CockroachDB. Some of them are features that can be controlled by the user, eg do not use triggers, others are that at least one function used by pgModeler does not appear to exist which would require a pgModeler code change.
I have performed one experiment which was partly successful - connection worked, diff code generated on a PostgreSQL DB executed on a CockroachDB instance worked, but a diff with a CockroachDB instance failed after 49 statements, see details below.
Sample image
Connection success:
49 statements successfully executed by pgModeler in a CockroachDB:
Experiment
Allow
, the Connection DBdefaultdb
, the rest of the connection info from the connect string generated when creating the CockroachDB instance, and verified that the connection worked.ERROR: unknown function: pg_tablespace_location(): function undefined
psql
.psql
CockroachDB connection, all commands were successfully executed.Default CockroachDB databases:
Stack trace:
The text was updated successfully, but these errors were encountered: