Using Postgresql
Hello,
I`m trying to use snipeit with postgresql 9.3. When i try to run php artisan app:install i get:
[Illuminate\Database\QueryException] SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "MODIFY" LINE 1: ALTER TABLE users MODIFY phone varchar(20) null ^ (SQL: ALTER TABLE users MODIFY phone varchar(20) null)
I cannot find any way to use postgresql, i have tried migrating the database from mysql to postgresql but this is not working either ( the queries are wrong ).
Please provide me some solution for using postgresql.
Best regards!
Snipe-IT is not supported on PostgreSQL. You'll need to use either MySQL or MariaDB.
If its not supported better remove the options from the database.php file, what is the purpose to have pgsql if it cant be used.
Anyway is someone succeeded to run it with pgsql? I managed to run it with pgsql but the queries to the db are not correct and i cannot add or view assets/companies/certs/etc.
The documentation pretty clearly states that only MySQL or MariaDB may be used.
Getting Snipe-IT to run on PostgreSQL will not be possible without major code changes, which will be unsupported. Snipe-IT version 3 is moving to a more recent version of the Laravel framework, which might have better support for non-MySQL database engines.
Thank you for the information, ddreier. When can we expect Snipe-IT 3 ?
BUMP When you state ''better support for non-MySQL...'' any idea if this will include MS SQL?
I make no claim that Snipe-IT will support non-MySQL database engines. Just that Laravel (the PHP framework that Snipe-IT is built on) has better support for them from what I hear.
Non-MySQL/MariaDB support will be experimental at the very least for v3. Future versions will hopefully be more compatible, however it is not currently our priority to make sure Snipe-IT works across non-MySQL/MariaDB databases for v3.
Has there been an update if we can use postgres instead of MySQL/MariaDB? Thanks,
Has there been an update if we can use postgres instead of MySQL/MariaDB? Thanks, I'm aware it is a big leap, But it could be really interesting.
Has there been an update if we can use postgres instead of MySQL/MariaDB? Thanks,
It would be useful in my setup +1
Is it possible to reopen this issue? postgresql support is very useful.
Hi, is there any update for this issue?
We do not plan on officially supporting postgres. Lots of changes have been made to improve compatibility with non-MySQL databases, but it's not going to be a priority in the foreseeable future. If you run into an issue running it on postgres, we'll try to fix it, but we just don't have the resources to test across more DBs than what we already have to support.
I would like to cast my vote for Postgres as well. It would be excellent if we could have this support in the near future.
got my vote for Postgres too, can't use it on mysql, (as we don't support mysql, nor want to run mysql, but we just found this app and it look amazing, and we want to use it)
As far as I know, we do support Postgres. We don’t officially support it, but I am aware of many folks who use it. We try very hard to optimize our queries so that they work on any SQL-based RDB. We don’t officially support it simply because of the additional time/cost in testing. Imagine this (very complex) system, and then having to duplicate all of the testing we already do. This works on SQLite, Postgres, MSSql (I’ve heard but not confirmed.)
Also this thread is literally from 2016. Please don’t rez old threads, since it alerts everyone who participated.
If there is a specific issue you’re running into running this on Postgres, by all means let us know - but AFAIK, this has not been an issue for some time.
Found a issue when using postgresql
Error Asset was not checked in, please try again{"physical":["The physical must be a number."]}
fixed with
ALTER TABLE assets
alter COLUMN physical DROP DEFAULT;
ALTER TABLE assets
alter COLUMN physical TYPE smallint USING case when physical=FALSE then 0 else 1 end;
ALTER TABLE assets
alter COLUMN physical SET DEFAULT=0;
@prescornic Thanks for the hin, we were running into the same issue.
However the last command has to be changed to:
ALTER TABLE assets alter COLUMN physical SET DEFAULT 0;
(without the assignment sign)
Cheers