Skip Menu |

This queue is for tickets about the SQL-Translator CPAN distribution.

Report information
The Basics
Id: 119911
Status: open
Priority: 0/
Queue: SQL-Translator

People
Owner: Nobody in particular
Requestors: KES [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: S::T::Producer::PostgreSQL produce UNIQUE CONSTRAINT instead of UNIQUE INDEX
From: wolfsage [...] gmail.com
On Thu Jan 19 09:35:35 2017, KES wrote: Show quoted text
> https://metacpan.org/source/ILMARI/SQL-Translator- > 0.11021/lib/SQL/Translator/Producer/PostgreSQL.pm#L551
I think the complaint here is that if you say: $sqlt_table->add_index( name => 'new_index', fields => [ 'lower(some_column)' ], type => 'unique', ); the producer tries to create it as a CONSTRAINT in the table definition (which is invalid) rather than a 'CREATE INDEX' statement which would allow things like 'lower(some_column)'. This makes add_index not-very-useful for a lot of cases.
I have introduce next changes to workaround the problem. https://github.com/dbsrgits/sql-translator/issues/82#issuecomment-276290608 I do not know how to fix that correctly. Hope it will help.