root@nyclapwxp2622:/var/lib/postgresql/8.3/main/base# ls
1 11510 11511 16387 16389 pgsql_tmp
What are these numbers? They're not database OID's:
mgogala=# select datname,datdba from pg_database;
datname | datdba
-----------+--------
template1 | 10
template0 | 10
postgres | 10
mgogala | 16386
scott | 16388
(5 rows)
If those numbers are not OIDs, what are they?
--
http://mgogala.freehostia.com
http://www.postgresql.org/docs/8.4/static/storage-file-layout.html
There is no direct correspondence between Oracle and PostgreSQL in this
case. PostgreSQL doesn't even touch the table when you COMMIT or
ROLLBACK. All that is done is that the transaction is marked as "failed"
or "succeeded". This information is tracked in the files in the "pg_clog"
directory.
> One more thing is quite confusing: in Postgres, a tablespace is a
> directory. That is why there is no "DBA_FREE_SPACE", one can simply use
> df -h and du -h. Also, I have another question. Here are files in the main
> directory:
>
> root@nyclapwxp2622:/var/lib/postgresql/8.3/main/base# ls
> 1 11510 11511 16387 16389 pgsql_tmp
>
>
> What are these numbers? They're not database OID's:
>
> mgogala=# select datname,datdba from pg_database;
> datname | datdba
> -----------+--------
> template1 | 10
> template0 | 10
> postgres | 10
> mgogala | 16386
> scott | 16388
> (5 rows)
What you select are the OIDs of the database owners, see
http://www.postgresql.org/docs/8.4/static/catalog-pg-database.html
Try:
SELECT oid, datname FROM pg_database;
OID is a special column, these days only used in catalog tables:
http://www.postgresql.org/docs/8.4/static/ddl-system-columns.html
Yours,
Laurenz Albe