Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retrieve list of indexes of a PostgreSQL table
Message
 
 
To
08/11/2012 10:12:41
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01556687
Message ID:
01556715
Views:
50
This message has been marked as a message which has helped to the initial question of the thread.
You are making it harder than it should be
TEXT TO cSelectStr NOSHOW
Select IndexDef 
  From   pg_indexes
  Where  TableName  = ?cTableName
ENDTEXT
>
>Thanks so much for your informatiom, found here http://www.postgresql.org/docs/9.2/static/view-pg-indexes.html, where you pointed me to.
>
>The code to retrieve the indexes is very simple:
>
> cIndexesStr = ""
>
> cSelectStr = "Select IndexDef                " + ;
>              "                               " + ;
>              "From   pg_indexes              " + ;
>              "                               " + ;
>              "Where  TableName  = ?cTableName"
>
> SQLexec (gSQLHandle, cSelectStr, "CurBuildIndexSQL") 
> 
> Select CurBuildIndexSQL
>
> If RecCount () = 0
>    Use In CurBuildIndexSQL
>    Return
> endif
>
> Select CurBuildIndexSQL
> Go     Top
>
> cIndexesStr = IndexDef
>
>Regards,
>
>Fernando
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform