|
|
Danh hiệu: Administration
Nhóm: Administrators
Gia nhập: 23-07-2013(UTC) Bài viết: 6,102   Đến từ: Vietnam Cảm ơn: 10 lần Được cảm ơn: 2 lần trong 2 bài viết
|
Display only table names and schema in PostgreSQL1.Get all tables and views from information_schema.tables, include those of information_schema and pg_catalog.Mã:select * from information_schema.tables
2. Get tables and views belong certain schemaMã:SELECT table_schema, table_name
FROM information_schema.tables
WHERE table_schema not in ('information_schema','pg_catalog')
order by table_schema, table_name;
3.Get tables onlyMã:select * from information_schema.tables
where table_schema not in ('information_schema', 'pg_catalog')
and table_type = 'BASE TABLE'
order by table_schema, table_name;
or Mã:SELECT concat_ws('.',table_schema, table_name)
FROM information_schema.tables
WHERE table_schema not in ('information_schema','pg_catalog')
and table_type = 'BASE TABLE'
order by table_schema, table_name;
4. Get tables only with schema 'public'Mã:SELECT table_schema, table_name
FROM information_schema.tables
WHERE table_schema = 'public'
order by table_schema, table_name;
|
|
|
|
|
|
Di chuyển
Bạn không thể tạo chủ đề mới trong diễn đàn này.
Bạn không thể trả lời chủ đề trong diễn đàn này.
Bạn không thể xóa bài của bạn trong diễn đàn này.
Bạn không thể sửa bài của bạn trong diễn đàn này.
Bạn không thể tạo bình chọn trong diễn đàn này.
Bạn không thể bỏ phiếu bình chọn trong diễn đàn này.