Recent

Author Topic: Postgres, ZEOS and Visual PlanIt - unable to create a table  (Read 6279 times)

wp

  • Hero Member
  • *****
  • Posts: 13353
Re: Postgres, ZEOS and Visual PlanIt - unable to create a table
« Reply #30 on: November 23, 2025, 10:45:38 pm »
I am not very experienced with ZEOS and MySQL/MariaDB. What is the value of the FConnection.Protocol in TVpZeosDatastore.AdjustSQLFieldTypeNames? Don't you have to set that to "mariadb" in order to tell ZEOS that it will find a MariaDB database? Or is there some autodetection so that you can leave Protocol empty?

I just tested my ZEOS datastore test project with protocol='mariadb' for a mysql database, and it is working correctly. Therefore, what happens when you set protocol to 'mysql' although you have a mariadb database?
« Last Edit: November 23, 2025, 10:54:23 pm by wp »

calebs

  • Full Member
  • ***
  • Posts: 215
Re: Postgres, ZEOS and Visual PlanIt - unable to create a table
« Reply #31 on: November 24, 2025, 08:14:18 pm »
i've been using zeos (stable 8 from OPM) and always use mysql as protocol with mysql or mariadb engines, in every version i've tried. (i believe until 10.x, cant recall used mariadb 11 or 12). And zeos always work with mysql as protocol on mysql or mariadb.
I dunno if zeos from vp is a newer version that makes difference but until now zeos 8 from opm always worked.
in the example i gave of the time that worked i was using maridb as db engine and mysql as protocol in zeos and worked fine.
netherveless, it didnt recognize mysql or mariadb because i've modified the two sections (mariadb and mysql) and never choses any of them. That's why worked when i change the "default values" i think from lines 127 and after

wp

  • Hero Member
  • *****
  • Posts: 13353
Re: Postgres, ZEOS and Visual PlanIt - unable to create a table
« Reply #32 on: November 25, 2025, 12:22:03 am »
I dunno if zeos from vp is a newer version that makes difference but until now zeos 8 from opm always worked.
I tested the ZEOS datastore and demo with ZEOS 8

in the example i gave of the time that worked i was using maridb as db engine and mysql as protocol in zeos and worked fine.
netherveless, it didnt recognize mysql or mariadb because i've modified the two sections (mariadb and mysql) and never choses any of them. That's why worked when i change the "default values" i think from lines 127 and after
Just to make sure that I am understanding correctly: You modified the first lines in TVpZeosDatastore.AdjustSQLFieldTypeNames to those that you showed earlier because the "if" code in the mysql and mariadb sections was not entered? Strange... It would be interesting what the debugger tells you for the value of the "protocol" variable when you put a break-point in this routine.

Nevertheless, I learned from your answer that it is not important to have Protocol='mysql' or 'mariadb' for a mysql or mariadb database. Therefore I merged both "if" branches into the same "if (protocol = 'mysql') or (protocol = 'mariadb')" in the latest version in the CCR SVN repository.

calebs

  • Full Member
  • ***
  • Posts: 215
Re: Postgres, ZEOS and Visual PlanIt - unable to create a table
« Reply #33 on: November 25, 2025, 02:23:23 pm »
thanks wp
first of all, careful with this
Quote
Nevertheless, I learned from your answer that it is not important to have Protocol='mysql' or 'mariadb' for a mysql or mariadb database. Therefore I merged both "if" branches into the same "if (protocol = 'mysql') or (protocol = 'mariadb')" in the latest version in the CCR SVN repository.
because mariadb was a clone of mysql but as i have seen lately they are trying to make difference in some ways with mysql, so, as i told you before, i havent tried latest mariadb servers and i don't know if 11 or 12 will work with mysql protocol or need mariadb protocol (someone with more knowledge of this engines can tell better). I think for compatibility should work but cant be sure of that.
I will try to debug that part to see if it enters or not in those if sections and share here the experiencie.

wp

  • Hero Member
  • *****
  • Posts: 13353
Re: Postgres, ZEOS and Visual PlanIt - unable to create a table
« Reply #34 on: November 25, 2025, 04:21:40 pm »
Well, I leave it like this for the moment. If we (=you) find an incompatibility with a later version of mariadb the two cases can be separated again easily.

calebs

  • Full Member
  • ***
  • Posts: 215
Re: Postgres, ZEOS and Visual PlanIt - unable to create a table
« Reply #35 on: January 18, 2026, 10:47:01 pm »
hello all again. creating manually the tables seem to work (at begining) and the components initializes.
Dropped a vpview, vpmonthview,vptasklist, a zconnection, a vpzeosdatastore, and vpcontrol link.
created the database with manually sql, then it generates a record on resources table.
the problem appears when i try to add some event in vpdayview, double click on some day/hour then fill in the window of untitled event with some description and anything else and click on ok then gives me an sql error.
I'll attach the sql i ve used to create the table on db.


andersonscinfo

  • Full Member
  • ***
  • Posts: 156
Re: Postgres, ZEOS and Visual PlanIt - unable to create a table
« Reply #36 on: January 18, 2026, 11:01:09 pm »
Hello,

The issue you're experiencing is likely due to differences between the expected table structure by Visual PlanIt components and the manually created tables. When you create tables manually, it's crucial to ensure that all fields, constraints, indexes, and triggers match exactly what the components expect.

Here are some steps to troubleshoot:

1. **Compare Table Structure**: Check if the table structure (field names, types, sizes, constraints) matches what Visual PlanIt expects. Often, components have specific requirements for field names and types.

2. **Check Primary Keys and Indexes**: Ensure all required primary keys and indexes are properly defined. Missing indexes can cause insertion problems.

3. **Auto-Increment Fields**: If there are ID fields that should auto-increment, make sure the sequence or auto-increment property is correctly set up in PostgreSQL.

4. **Triggers and Constraints**: Some components rely on database triggers or specific constraints to work properly. Check if these were created.

5. **ZEOS Component Configuration**: Verify that your ZConnection and VPZEOSDataStore components are properly configured with correct connection parameters and that they're compatible with PostgreSQL version you're using.

6. **Debug the SQL Error**: Enable detailed logging in your application to see the exact SQL statement that's causing the error. This will give you a precise idea of what's going wrong.

Could you share the SQL error message you're getting? That would help pinpoint the exact issue.

Also, the SQL script you used to create the tables would be helpful to compare against the expected structure.

Att.

calebs

  • Full Member
  • ***
  • Posts: 215
Re: Postgres, ZEOS and Visual PlanIt - unable to create a table
« Reply #37 on: January 19, 2026, 04:48:18 am »
Hello,

The issue you're experiencing is likely due to differences between the expected table structure by Visual PlanIt components and the manually created tables. When you create tables manually, it's crucial to ensure that all fields, constraints, indexes, and triggers match exactly what the components expect.

Here are some steps to troubleshoot:

1. **Compare Table Structure**: Check if the table structure (field names, types, sizes, constraints) matches what Visual PlanIt expects. Often, components have specific requirements for field names and types.

2. **Check Primary Keys and Indexes**: Ensure all required primary keys and indexes are properly defined. Missing indexes can cause insertion problems.

3. **Auto-Increment Fields**: If there are ID fields that should auto-increment, make sure the sequence or auto-increment property is correctly set up in PostgreSQL.

4. **Triggers and Constraints**: Some components rely on database triggers or specific constraints to work properly. Check if these were created.

5. **ZEOS Component Configuration**: Verify that your ZConnection and VPZEOSDataStore components are properly configured with correct connection parameters and that they're compatible with PostgreSQL version you're using.

6. **Debug the SQL Error**: Enable detailed logging in your application to see the exact SQL statement that's causing the error. This will give you a precise idea of what's going wrong.

Could you share the SQL error message you're getting? That would help pinpoint the exact issue.

Also, the SQL script you used to create the tables would be helpful to compare against the expected structure.

Att.

hi, the error is attached on the two snapshots in my post (had to split it because its too long and windows capture can't handle 2 monitors). I had to create manually the databases because it won't auto create them on first online (it always gives an error) the script for create it its also attached on my post. The script to create database and tables i made it taking the official info that i've found for the component

Thaddy

  • Hero Member
  • *****
  • Posts: 18729
  • To Europe: simply sell USA bonds: dollar collapses
Re: Postgres, ZEOS and Visual PlanIt - unable to create a table
« Reply #38 on: January 19, 2026, 07:00:03 am »
What I am missing is this: table creation manually succeeds.
Tables need a database/datastore.
Looks like that is missing/ not set when you use the components, so create that first: only then you can add and create tables.
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

 

TinyPortal © 2005-2018