Thread: Creating a new database in pgadmin
Hello, I would like to create a database in a different hard drive than the one in which pgadmin is installed. I've been looking through the options of pgadmin and I haven't seen anything. The reason I'm doing this is because this new database I'm going to create will be huge and I need lots of space. Can anyone help me with this issue?? Thanks in advance. Best regards -- View this message in context: http://old.nabble.com/Creating-a-new-database-in-pgadmin-tp27930484p27930484.html Sent from the PostgreSQL - pgadmin support mailing list archive at Nabble.com.
On 17 March 2010 11:10, javib <javier.burgos@ricoh.es> wrote:
You will need to create a new tablespace onto the other hard drive then create the database using that tablespace:
Hello,
I would like to create a database in a different hard drive than the one in
which pgadmin is installed. I've been looking through the options of pgadmin
and I haven't seen anything. The reason I'm doing this is because this new
database I'm going to create will be huge and I need lots of space.
Can anyone help me with this issue??
Thanks in advance.
Best regards
--
For example:
CREATE TABLESPACE new_space LOCATION '/media/otherdrive';
CREATE DATABASE new_db TABLESPACE new_space;
Regards
Thom
Thanks for replying so fast Thom. I tried the following line and it didn't work: CREATE TABLESPACE otraParti LOCATION '/media/Iomega HDD(F:)' and I'm getting the following error: ERROR: couldn't define permissions for directory «/media/Iomega HDD(F:)»: No such file or directory Any ideas? Thom Brown wrote: > > On 17 March 2010 11:10, javib <javier.burgos@ricoh.es> wrote: > >> >> Hello, >> I would like to create a database in a different hard drive than the one >> in >> which pgadmin is installed. I've been looking through the options of >> pgadmin >> and I haven't seen anything. The reason I'm doing this is because this >> new >> database I'm going to create will be huge and I need lots of space. >> Can anyone help me with this issue?? >> >> Thanks in advance. >> Best regards >> -- >> >> > You will need to create a new tablespace onto the other hard drive then > create the database using that tablespace: > > For example: > > CREATE TABLESPACE new_space LOCATION '/media/otherdrive'; > > CREATE DATABASE new_db TABLESPACE new_space; > > Regards > > Thom > > -- View this message in context: http://old.nabble.com/Creating-a-new-database-in-pgadmin-tp27930480p27930670.html Sent from the PostgreSQL - pgadmin support mailing list archive at Nabble.com.
<div class="gmail_quote">On 17 March 2010 11:29, javib <span dir="ltr"><<a href="mailto:javier.burgos@ricoh.es">javier.burgos@ricoh.es</a>></span>wrote:<br /><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br /> Thanks for replyingso fast Thom. I tried the following line and it didn't<br /> work:<br /><br /> CREATE TABLESPACE otraParti LOCATION'/media/Iomega HDD(F:)'<br /><br /> and I'm getting the following error:<br /> ERROR: couldn't define permissionsfor directory «/media/Iomega HDD(F:)»: No<br /> such file or directory<br /><br /> Any ideas?<br /></blockquote></div><br/><br />Is that directory owned by the postgres user? And does it exist at all? If you're usingWindows, I'm not sure you can even use tablespaces. The "/media/otherdrive" example was a full path to a destination,so it could be "/mnt/drive/" or "/external" or something like that.<br /><br />Thom<br />
Le 17/03/2010 12:29, javib a écrit : > > Thanks for replying so fast Thom. I tried the following line and it didn't > work: > > CREATE TABLESPACE otraParti LOCATION '/media/Iomega HDD(F:)' > > and I'm getting the following error: > ERROR: couldn't define permissions for directory «/media/Iomega HDD(F:)»: No > such file or directory > > Any ideas? > You should probably look at the manual page for CREATE TABLESPACE: http://www.postgresql.org/docs/8.4/interactive/sql-createtablespace.html You need to put in the location field the name of the directory in which you want to store your database/table. And be sure postgres has permissions to read/write in this directory. BTW, you can use pgAdmin to create this tablespace. Could be simpler. -- Guillaume.http://www.postgresqlfr.orghttp://dalibo.com
Le 17/03/2010 12:37, Thom Brown a écrit : > On 17 March 2010 11:29, javib <javier.burgos@ricoh.es> wrote: > >> >> Thanks for replying so fast Thom. I tried the following line and it didn't >> work: >> >> CREATE TABLESPACE otraParti LOCATION '/media/Iomega HDD(F:)' >> >> and I'm getting the following error: >> ERROR: couldn't define permissions for directory «/media/Iomega HDD(F:)»: >> No >> such file or directory >> >> Any ideas? >> > > > Is that directory owned by the postgres user? And does it exist at all? If > you're using Windows, I'm not sure you can even use tablespaces. The > "/media/otherdrive" example was a full path to a destination, so it could be > "/mnt/drive/" or "/external" or something like that. > You can use tablespaces on Windows. It won't be a /media/something path though. It will probably be something like F:/path/to/my/directory . -- Guillaume.http://www.postgresqlfr.orghttp://dalibo.com
How can I assign permissions to postgress to access the drive? Thanks! Guillaume Lelarge-3 wrote: > > Le 17/03/2010 12:37, Thom Brown a écrit : >> On 17 March 2010 11:29, javib <javier.burgos@ricoh.es> wrote: >> >>> >>> Thanks for replying so fast Thom. I tried the following line and it >>> didn't >>> work: >>> >>> CREATE TABLESPACE otraParti LOCATION '/media/Iomega HDD(F:)' >>> >>> and I'm getting the following error: >>> ERROR: couldn't define permissions for directory «/media/Iomega >>> HDD(F:)»: >>> No >>> such file or directory >>> >>> Any ideas? >>> >> >> >> Is that directory owned by the postgres user? And does it exist at all? >> If >> you're using Windows, I'm not sure you can even use tablespaces. The >> "/media/otherdrive" example was a full path to a destination, so it could >> be >> "/mnt/drive/" or "/external" or something like that. >> > > You can use tablespaces on Windows. It won't be a /media/something path > though. It will probably be something like F:/path/to/my/directory . > > > -- > Guillaume. > http://www.postgresqlfr.org > http://dalibo.com > > -- > Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgadmin-support > > -- View this message in context: http://old.nabble.com/Creating-a-new-database-in-pgadmin-tp27930480p27930918.html Sent from the PostgreSQL - pgadmin support mailing list archive at Nabble.com.
Le 17/03/2010 12:51, javib a écrit : > > How can I assign permissions to postgress to access the drive? Depends on you operating system, which you still haven't told us. I suppose this is on Windows. Right click on your directory, choose Properties, click on the Security tab, check if the postgres user has all permissions on the directory. If it doesn't or if he is not listed in the users' list, add him and give him all the permissions. -- Guillaume.http://www.postgresqlfr.orghttp://dalibo.com
Thanks!! It works now. My OS is windows. I've created the new tablespace with the pgadmin following the instructions and works fine!! Thanks againn Guillaume Lelarge-3 wrote: > > Le 17/03/2010 12:51, javib a écrit : >> >> How can I assign permissions to postgress to access the drive? > > Depends on you operating system, which you still haven't told us. I > suppose this is on Windows. Right click on your directory, choose > Properties, click on the Security tab, check if the postgres user has > all permissions on the directory. If it doesn't or if he is not listed > in the users' list, add him and give him all the permissions. > > > -- > Guillaume. > http://www.postgresqlfr.org > http://dalibo.com > > -- > Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgadmin-support > > -- View this message in context: http://old.nabble.com/Creating-a-new-database-in-pgadmin-tp27930480p27931150.html Sent from the PostgreSQL - pgadmin support mailing list archive at Nabble.com.
On 17 March 2010 11:40, Guillaume Lelarge <guillaume@lelarge.info> wrote:
Le 17/03/2010 12:37, Thom Brown a écrit :You can use tablespaces on Windows. It won't be a /media/something path> On 17 March 2010 11:29, javib <javier.burgos@ricoh.es> wrote:
>
>>
>> Thanks for replying so fast Thom. I tried the following line and it didn't
>> work:
>>
>> CREATE TABLESPACE otraParti LOCATION '/media/Iomega HDD(F:)'
>>
>> and I'm getting the following error:
>> ERROR: couldn't define permissions for directory «/media/Iomega HDD(F:)»:
>> No
>> such file or directory
>>
>> Any ideas?
>>
>
>
> Is that directory owned by the postgres user? And does it exist at all? If
> you're using Windows, I'm not sure you can even use tablespaces. The
> "/media/otherdrive" example was a full path to a destination, so it could be
> "/mnt/drive/" or "/external" or something like that.
>
though. It will probably be something like F:/path/to/my/directory .
Ah, okay. I was just thrown by the note in the documentation which says, "Tablespaces are only supported on systems that support symbolic links.". I'm not sure that's true.
Thom
Le 17/03/2010 13:49, Thom Brown a écrit : > On 17 March 2010 11:40, Guillaume Lelarge <guillaume@lelarge.info> wrote: > >> Le 17/03/2010 12:37, Thom Brown a écrit : >>> On 17 March 2010 11:29, javib <javier.burgos@ricoh.es> wrote: >>> >>>> >>>> Thanks for replying so fast Thom. I tried the following line and it >> didn't >>>> work: >>>> >>>> CREATE TABLESPACE otraParti LOCATION '/media/Iomega HDD(F:)' >>>> >>>> and I'm getting the following error: >>>> ERROR: couldn't define permissions for directory «/media/Iomega >> HDD(F:)»: >>>> No >>>> such file or directory >>>> >>>> Any ideas? >>>> >>> >>> >>> Is that directory owned by the postgres user? And does it exist at all? >> If >>> you're using Windows, I'm not sure you can even use tablespaces. The >>> "/media/otherdrive" example was a full path to a destination, so it could >> be >>> "/mnt/drive/" or "/external" or something like that. >>> >> >> You can use tablespaces on Windows. It won't be a /media/something path >> though. It will probably be something like F:/path/to/my/directory . >> >> > Ah, okay. I was just thrown by the note in the documentation which says, > "Tablespaces are only supported on systems that support symbolic links.". > I'm not sure that's true. > It's true. It basically means you cannot use tablespace on Windows NT4. Other Windows NT (2000, XP, 2003, Vista, 2008, 7) don't have this issue. (Dave / Magnus, correct me if I say stupid things :) ) -- Guillaume.http://www.postgresqlfr.orghttp://dalibo.com