kokizzu / wwwsqldesigner

Automatically exported from code.google.com/p/wwwsqldesigner
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Cannot create index (not Primary Key nor UNIQUE) on postgresql #139

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
 1. Create a table has some columns,  then set its database type to postgreSQL.
 2. Add index to the table, set its type to "INDEX".
 3. Do "save" and create sql.

-- expected --
CREATE TABLE "sometable" (
 col1 type1,
 col2 type2
);
CREATE index "someindex" (col1); 
-- actual output --
CREATE TABLE "sometable" (
 col1 type1,
 col2 type2,
 KEY (col)
);
--

wwwsqldesigner 2.6 ,  Linux, Mac OS etc. , postgresql 9.0.6.

I think db/output.xsl might be incorrect.
I wrote experimental alternative code. 
please refer attached file, that contains my change.

Original issue reported on code.google.com by tsamu...@gmail.com on 28 Oct 2011 at 9:34

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

the postgresql datatype and XSL file is a contributed code. I personally have a 
very low experience with pgsql. Perhaps the "KEY(col)" syntax is for some older 
versions of postgresql? It would be nice to verify and confirm prior to 
replacing with your template...

Original comment by ondrej.zara on 29 Oct 2011 at 6:22

GoogleCodeExporter commented 9 years ago
Thank you for a reply.

I cannot find such a syntax  "CREATE TABLE .... , KEY(col [, col2 ...])" in any 
older version of pgsql.

http://www.postgresql.org/docs/6.3/static/c0403.htm
http://www.postgresql.org/docs/7.4/static/sql-createtable.html
http://www.postgresql.org/docs/9.0/static/sql-createtable.html

I send my XSL file, seems to be fine.  I tested it with pgsql v9.0.1 .
Please test it among other contributors.

Regards.

Original comment by tsamu...@gmail.com on 2 Nov 2011 at 11:24

Attachments:

GoogleCodeExporter commented 9 years ago
Okay, I will apply your changes to the repository.

Original comment by ondrej.zara on 15 Nov 2011 at 8:11