Giter VIP home page Giter VIP logo

Comments (5)

givanz avatar givanz commented on May 25, 2024

Thanks for the bug report.

This happens because pgsql uses sequences to generate id's unlike mysql or sqlite which uses the max/last inserted id.

The sample data from menus and categories is inserted with ids while the sequence starts with 1 and this causes primary id conflict.

I added setvalue for sequences to match the last insert id in /install/sql/pgsql/schema/

If you don't want to reinstall you can try this fix

https://wiki.postgresql.org/wiki/Fixing_Sequences

from vvveb.

jeromeatneotek avatar jeromeatneotek commented on May 25, 2024

Would it be fair to say, that I am likley to experience less issues if I were to use mysql, or specifically mariaDB, because that is what you are developing first?

from vvveb.

givanz avatar givanz commented on May 25, 2024

Testing is done mostly on mysql but now with the latest fixes pgsql is also up to date.

from vvveb.

jeromeatneotek avatar jeromeatneotek commented on May 25, 2024

The code from the link https://wiki.postgresql.org/wiki/Fixing_Sequences didn't return any records! SO there was no updates to reset the sequence values.
I am an MS SQL developer, what kind of effort do you think it would require from me to port to MS SQL?

from vvveb.

givanz avatar givanz commented on May 25, 2024

It doesn't work for me either probably because sequences were not associated with tables with OWNED BY table.col

The first step is to write the driver /system/db/mssql.php, you need to implement methods like execute, fetch_row, get_all etc https://github.com/givanz/Vvveb/blob/master/system/db/pgsql.php

The second step is to add a new SqlP template /system/sqlp/mssql.php https://github.com/givanz/Vvveb/blob/master/system/sqlp/pgsql.php that provides the code snippets that generates the php code from sql files that calls the mssql driver code.

The third step is to convert the sql code that creates the tables install/sql/mssql https://github.com/givanz/Vvveb/tree/master/install/sql/pgsql

And the last step is to convert the sql queries admin/sql/mssql and app/sql/mssql https://github.com/givanz/Vvveb/tree/master/admin/sql/pgsql

Most sql code is ansi compatible with very small differences between mysql,sqlite and pgsql probably it will work on mssql also with very little changes.

from vvveb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.