Skip to content

Instantly share code, notes, and snippets.

@sposmen
Created August 23, 2012 14:59
Show Gist options
  • Save sposmen/3437486 to your computer and use it in GitHub Desktop.
Save sposmen/3437486 to your computer and use it in GitHub Desktop.
Check boolean columns on postgres database
SELECT table_name, column_name, column_default, is_nullable
FROM information_schema.columns
WHERE data_type = 'boolean'
and table_schema = 'public'
and column_default is null or column_default = ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment