I am trying to run oracle query
SELECT OWNER,
TABLE_NAME
FROM ALL_TABLES;
SELECT COLUMN_NAME,
DATA_TYPE,
DATA_LENGTH,
NULLABLE,
COLUMN_ID,
DATA_PRECISION,
DATA_SCALE
FROM ALL_TAB_COLUMNS
in postgresql but it is not able to excute that because PostgreSQL doesn't have ALL_TAB_COLUMNS and ALL_TABLES
Can any body suggest what is the equivalent query of that
ALL_TAB_COLUMNS describes the columns of the tables, views, and clusters accessible to the current user. To gather statistics for this view, use the ANALYZE SQL statement or the DBMS_STATS package. Related Views. DBA_TAB_COLUMNS describes the columns of all tables, views, and clusters in the database.
The information schema is a built-in schema that's common to every PostgreSQL database. You can run SQL queries against tables in the information_schema to fetch schema metadata for a database. For example, the following query fetches the names of all user-defined tables in a database: SELECT. table_name.
ALL_TABLES is equivalent to the (ANSI standard) view information_schema.tables
: http://www.postgresql.org/docs/current/static/infoschema-tables.html
ALL_TAB_COLUMNS is equivalent to the (ANSI standard) view information_schema.columns
: http://www.postgresql.org/docs/current/static/infoschema-columns.html
information_schema.columns lacks the Num_Distinct and Num_Nulls information columns.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With