snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Using Postgresql

Open PMarkovski opened this issue 10 years ago • 18 comments

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!

PMarkovski avatar Apr 04 '16 12:04 PMarkovski

Snipe-IT is not supported on PostgreSQL. You'll need to use either MySQL or MariaDB.

ddreier avatar Apr 04 '16 13:04 ddreier

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.

PMarkovski avatar Apr 04 '16 18:04 PMarkovski

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.

ddreier avatar Apr 04 '16 18:04 ddreier

Thank you for the information, ddreier. When can we expect Snipe-IT 3 ?

PMarkovski avatar Apr 04 '16 20:04 PMarkovski

BUMP When you state ''better support for non-MySQL...'' any idea if this will include MS SQL?

babz777 avatar Apr 14 '16 16:04 babz777

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.

ddreier avatar Apr 14 '16 16:04 ddreier

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.

snipe avatar Apr 19 '16 09:04 snipe

Has there been an update if we can use postgres instead of MySQL/MariaDB? Thanks,

azamatsiddiqui avatar Jun 10 '19 18:06 azamatsiddiqui

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.

dscaravaggi avatar Jun 22 '19 13:06 dscaravaggi

Has there been an update if we can use postgres instead of MySQL/MariaDB? Thanks,

It would be useful in my setup +1

lsnow99 avatar Dec 21 '19 20:12 lsnow99

Is it possible to reopen this issue? postgresql support is very useful.

pva avatar Jul 27 '20 08:07 pva

Hi, is there any update for this issue?

mikaeldiok avatar Sep 22 '21 04:09 mikaeldiok

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.

snipe avatar Sep 22 '21 04:09 snipe

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.

iodize6399 avatar May 09 '22 09:05 iodize6399

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)

bovinemagnet avatar Sep 21 '22 01:09 bovinemagnet

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.

snipe avatar Sep 21 '22 01:09 snipe

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 avatar Jan 04 '23 11:01 prescornic

@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

fritzdimmel avatar Jun 20 '23 10:06 fritzdimmel