I hava a table gtlions.cannottruncatetable, ZERO rows in this table, i can DELETE from the table, but can not TRUNCATE, hang the statement sql.
Detail info below:
###################On the session 1:
gtlions=# select version();
version
------------------------------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 8.2.15 (Greenplum Database 4.2.5.2 build 1) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on May 16 2013 23:35:01
(1 row)
gtlions=# \d+ gtlions.cannottruncatetable
Table "gtlions.cannottruncatetable"
Column | Type | Modifiers | Storage | Description
------------------+------------------------+-----------+----------+-------------
host_ip | character varying | | extended |
sys_int_id | numeric | | main |
hostname | character varying | | extended |
prog_name | character varying(300) | | extended |
app_name | character varying | | extended |
app_name_en | character varying | | extended |
app_id | numeric(12,0) | | main |
serverport | numeric(22,0) | | main |
logpath | numeric(22,0) | | main |
log_generall | numeric(22,0) | | main |
log_detail | numeric(22,0) | | main |
transaction_open | numeric(22,0) | | main |
generall_open | numeric(22,0) | | main |
is_use | numeric(22,0) | | main |
id | numeric(22,0) | | main |
logmasterswitch | numeric(22,0) | | main |
process_numb | numeric(22,0) | | main |
process_total | numeric(22,0) | | main |
ips_addr | character varying | | extended |
host_id | numeric(8,0) | | main |
prog_id | numeric(8,0) | | main |
prog_apptypeid | numeric(8,0) | | main |
Has OIDs: no
Distributed by: (app_id)
gtlions=# select count(*) from gtlions.cannottruncatetable;
count
-------
0
(1 row)
gtlions=# select * from pg_class where relname='cannottruncatetable';
relname | relnamespace | reltype | relowner | relam | relfilenode | reltablespace | relpages | reltuples | reltoastrelid | reltoastidxid | relaosegrel
id | relaosegidxid | relhasindex | relisshared | relkind | relstorage | relnatts | relchecks | reltriggers | relukeys | relfkeys | relrefs | relhasoids | relhaspkey |
relhasrules | relhassubclass | relfrozenxid | relacl | reloptions
------------------------+--------------+----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+------------
---+---------------+-------------+-------------+---------+------------+----------+-----------+-------------+----------+----------+---------+------------+------------+-
------------+----------------+--------------+--------+------------
cannottruncatetable | 17021 | 11051471 | 17010 | 0 | 23496358 | 0 | 19 | 0 | 11052150 | 0 |
0 | 0 | f | f | r | h | 22 | 0 | 0 | 0 | 0 | 0 | f | f |
f | f | 1558748414 | |
(1 row)
gtlions=# select pg_size_pretty(pg_relation_size('gtlions.cannottruncatetable'));
pg_size_pretty
----------------
608 kB
(1 row)
gtlions=# vacuum analyze gtlions.cannottruncatetable;
VACUUM
gtlions=# select * from pg_class where relname='cannottruncatetable';
relname | relnamespace | reltype | relowner | relam | relfilenode | reltablespace | relpages | reltuples | reltoastrelid | reltoastidxid | relaosegrel
id | relaosegidxid | relhasindex | relisshared | relkind | relstorage | relnatts | relchecks | reltriggers | relu