Skip to content

Instantly share code, notes, and snippets.

@geobabbler
Created November 23, 2014 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geobabbler/8807cbe35d57d3d2f869 to your computer and use it in GitHub Desktop.
Save geobabbler/8807cbe35d57d3d2f869 to your computer and use it in GitHub Desktop.
//SQL to retrieve schema
//var sql = "SELECT n.nspname as schemaname,c.relname as table_name,a.attname as column_name,format_type(a.atttypid, a.atttypmod) AS //type,col_description(a.attrelid, a.attnum) as comments";
//sql = sql + " FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid LEFT JOIN pg_attribute a ON a.attrelid = c.oid";
//sql = sql + " WHERE a.attnum > 0 and c.relname = '" + tablename + "' and n.nspname = '" + schemaname + "';";
//SQL to retrieve layer list
//sql = "SELECT 'geometry' AS geotype, * FROM geometry_columns UNION SELECT 'geography' as geotype, * FROM geography_columns;";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment