Обсуждение: 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
On your Data Directory?
----- Original Message -----From: John McLeanSent: Tuesday, November 13, 2012 5:00 PMSubject: [NOVICE] createdbHi,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?ThanksJohn
On Tue, Nov 13, 2012 at 9:00 AM, John McLean <johnmclean80@gmail.com> wrote: > 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. > > If not, where are the files that this command creates? depends on which OS you're using, and where you got your postgresql build.
hi, On Tue, 2012-11-13 at 17:00 +0000, John McLean wrote: > When one runs: createdb 'database' > > should this create a directory named 'database' in the working directory? No. > 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