Skip to content

Instantly share code, notes, and snippets.

@brandonrachal
Created September 19, 2025 22:43
Show Gist options
  • Select an option

  • Save brandonrachal/4232367321d8bd7a94ea7d49ded636be to your computer and use it in GitHub Desktop.

Select an option

Save brandonrachal/4232367321d8bd7a94ea7d49ded636be to your computer and use it in GitHub Desktop.
Handy commands for postgres
select
column_name,
data_type,
character_maximum_length,
is_nullable,
column_default
from
information_schema.columns
where
table_name = 'some_table_name'
order by
ordinal_position;
select * from pg_catalog.pg_roles;
select * from pg_database where datname = 'some_database_name';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment