Discussion:
createdb
(too old to reply)
John McLean
2012-11-13 17:00:49 UTC
Permalink
Hi,

When one runs: createdb 'database'

should this create a directory named 'database' in the working directory?

If not, where are the files that this command creates?

Thanks
John
Oliveiros d'Azevedo Cristina
2012-11-13 17:06:12 UTC
Permalink
On your Data Directory?
----- Original Message -----
From: John McLean
To: pgsql-***@postgresql.org
Sent: Tuesday, November 13, 2012 5:00 PM
Subject: [NOVICE] createdb


Hi,


When one runs: createdb 'database'


should this create a directory named 'database' in the working directory?


If not, where are the files that this command creates?


Thanks
John
Lonni J Friedman
2012-11-13 17:07:27 UTC
Permalink
Post by John McLean
Hi,
When one runs: createdb 'database'
should this create a directory named 'database' in the working directory?
no, that's not how postgresql organizes its filesystem layout.
Post by John McLean
If not, where are the files that this command creates?
depends on which OS you're using, and where you got your postgresql build.
--
Sent via pgsql-novice mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice
Devrim GÜNDÜZ
2012-11-13 17:09:03 UTC
Permalink
hi,
Post by John McLean
When one runs: createdb 'database'
should this create a directory named 'database' in the working directory?
No.
Post by John McLean
If not, where are the files that this command creates?
All database files are under the database data directory by default, and
the actual location depends on the OS/distro that you are using. For
example, on my Fedora box, they are under /var/lib/pgsql/9.2/data/base
directory (notice data/base, which resolves to database). You can find
out yours by connecting to database and running:

SHOW data_directory ;

Then you will see OIDs of each database under the base/ directory. You
can query them by running:

SELECT oid, datname FROM pg_database;

or use oid2name command line utility.

Hope this will be a start.

Regards,
--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz
Loading...