3

I am using PostgreSQL and I want to add a new data files to existing tablespace ( like in oracle )

I could not found any description on this on PostgreSQL documentation. How to do this ?

3
  • 2
    What is a "data file" in this context? This doesn't make a ton of sense. What are you trying to accomplish? What's the underlying problem you are attempting to solve? Commented Jun 11, 2014 at 9:26
  • when current tablespace is not enough ( in size ) how we can extend the size of tablespace while table is is been used by application ( may be by transactions) ? Commented Jun 11, 2014 at 9:37
  • This is why it helps if you explain what you intend to do, and why. Don't just say "how do I do X from Oracle in PostgreSQL" - try to explain what X is and why you want it. Commented Jun 11, 2014 at 11:21

1 Answer 1

8

PotgreSQL works different than Oracle. It has a much simpler concept for data storage. Data blocks, extents and segments don't exist. In the same spirit, a tablespace is not split into multiple data files. You just create the tablespace and PostgreSQL creates the necessary files to store the data.

When creating a tablespace, you can provide a location, where PostgreSQL should store the data:

CREATE TABLESPACE dbspace LOCATION '/data/dbs';

This works similar to bigfile tablespaces in Oracle, where you also don't have to manage data files.

Sign up to request clarification or add additional context in comments.

1 Comment

But how can I extend the tablespace space beyond the current disk capacity? Oracle works that way so you can add infinite amount of new disks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.