New issue 214 by abe.gillespie: Getting constraint name from Postgres
http://code.google.com/p/dblinq2007/issues/detail?id=214
I noticed today while I perused the code that the Postgres provider does
not do a good job getting constraint names. It's assuming the name for a
PRIMARY KEY ends with "_pkey". This won't work. Primary keys may be
named anything you desire, having the "_pkey" suffix is merely an artifact
of the constraint added by the pgAdmin GUI. The following query should
clue you in on what's necessary:
select constraint_name from information_schema.table_constraints where
table_schema=@schema and table_name=@view and
constraint_type='PRIMARY KEY'
I did some detective work to find this which might help you in the future as
well. I turn on SQL Statement logging for Postgres and then use the
pgAdmin GUI to explore my DB. All the queries that the GUI does will be
logged and should allow you to figure out most anything schema related.
Thanks.
-Abe
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
Comment #1 on issue 214 by anders...@gmail.com: Getting constraint name
from Postgres
http://code.google.com/p/dblinq2007/issues/detail?id=214
Thanks for pointing it out. It was marked with a todo in the code.
Glad I could help. Please keep up the great work; you've got a very
impressive and
extremely useful project going here.
Hey, I fix it and another issues. You can download the source here: