473,466 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

error moving table to tablespace (8.0 beta win32 )

Hi!

just playing with tablespaces...

- moved a existing table to a new tablespace
- tried to move it back to default tablespace
(ALTER TABLE accounts SET TABLESPACE pg_default;)

Got the following error in logfile:

ERROR: could not create relation 1663/317186/317191: Permission denied

Any suggestions?

Best regards,
Christian

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #1
5 3291
Christian Traber wrote:
Hi!

just playing with tablespaces...

- moved a existing table to a new tablespace
- tried to move it back to default tablespace
(ALTER TABLE accounts SET TABLESPACE pg_default;)

Got the following error in logfile:

ERROR: could not create relation 1663/317186/317191: Permission denied

Any suggestions?

are you able to create new tables in the default tablespace ? looks
like a permission issue did you initdb a fresh folder see if the
owner of $PGDATA/data/base is the user that running postmaster
(usually postgres) . It works fine for me though

Regds
mallah

test=# \d t_b
Table "public.t_b"
Column | Type | Modifiers
--------+---------+-----------
a | integer |
Tablespace: "space"

test=# ALTER TABLE t_b SET TABLESPACE pg_default;
ALTER TABLE
test=# SELECT version();
version
--------------------------------------------------------------------------------------------------------------
PostgreSQL 8.0.0beta1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC)
3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)
(1 row)

test=#



Best regards,
Christian

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

--

regds
Mallah.

Rajesh Kumar Mallah
+---------------------------------------------------+
| Tradeindia.com (3,11,246) Registered Users |
| Indias' Leading B2B eMarketPlace |
| http://www.tradeindia.com/ |
+---------------------------------------------------+
Nov 23 '05 #2
Rajesh Kumar Mallah wrote:
are you able to create new tables in the default tablespace ?
Yes, permissions are ok.

looks like a permission issue did you initdb a fresh folder see if the
owner of $PGDATA/data/base is the user that running postmaster
(usually postgres) . It works fine for me though
initdb was run by windows installer

Regds
mallah

test=# \d t_b
Table "public.t_b"
Column | Type | Modifiers
--------+---------+-----------
a | integer |
Tablespace: "space"

test=# ALTER TABLE t_b SET TABLESPACE pg_default;
ALTER TABLE
test=# SELECT version();
version
--------------------------------------------------------------------------------------------------------------
PostgreSQL 8.0.0beta1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC)
3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)
(1 row)

test=#


Maybe its only win32 version?

Here what i tried:

CREATE TABLE test (name varchar(100));
CREATE TABLE

CREATE TABLESPACE test LOCATION 'C:\\tmp\\ts_test';
CREATE TABLESPACE

\db
List of tablespaces
Name | Owner | Location
------------+----------+----------------
pg_default | postgres |
pg_global | postgres |
test | postgres | C:/tmp/ts_test
(3 rows)

ALTER TABLE test SET TABLESPACE test;
ALTER TABLE

\d+ test
Table "public.test"
Column | Type | Modifiers | Description
--------+------------------------+-----------+-------------
name | character varying(100) | |
Contains OIDs: yes
Tablespace: "test"

ALTER TABLE test SET TABLESPACE pg_default;
ERROR: could not create relation 1663/317186/1317654: Permission denied

select version();
version

----------------------------------------------------------------------------------------------------------
PostgreSQL 8.0.0beta1 on i686-pc-mingw32, compiled by GCC gcc.exe
(GCC) 3.2.3 (mingw special 20030504-1)
(1 row)

Thanks and regards
Christian
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #3
Christian Traber <ch*******@traber-net.de> writes:
Maybe its only win32 version?
Well, I can't reproduce it on Unix. It seems awfully odd though that
you can create tables in that tablespace to begin with but can't move
them there. I'm cc'ing this to the pgsql-hackers-win32 to see if anyone
there has a clue ...

regards, tom lane
Here what i tried: CREATE TABLE test (name varchar(100));
CREATE TABLE CREATE TABLESPACE test LOCATION 'C:\\tmp\\ts_test';
CREATE TABLESPACE \db
List of tablespaces
Name | Owner | Location
------------+----------+----------------
pg_default | postgres |
pg_global | postgres |
test | postgres | C:/tmp/ts_test
(3 rows) ALTER TABLE test SET TABLESPACE test;
ALTER TABLE \d+ test
Table "public.test"
Column | Type | Modifiers | Description
--------+------------------------+-----------+-------------
name | character varying(100) | |
Contains OIDs: yes
Tablespace: "test" ALTER TABLE test SET TABLESPACE pg_default;
ERROR: could not create relation 1663/317186/1317654: Permission denied select version();
version ----------------------------------------------------------------------------------------------------------
PostgreSQL 8.0.0beta1 on i686-pc-mingw32, compiled by GCC gcc.exe
(GCC) 3.2.3 (mingw special 20030504-1)
(1 row)


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #4
Tom Lane wrote:
Christian Traber <ch*******@traber-net.de> writes:
Maybe its only win32 version?

Well, I can't reproduce it on Unix. It seems awfully odd though that
you can create tables in that tablespace to begin with but can't move
them there. I'm cc'ing this to the pgsql-hackers-win32 to see if anyone
there has a clue ...


I just reproduced this on win32. The file already exists, and is locked.
Apparently, in this case it's the very same backend that's locking the
file; closing the connection that was used to move the table into the
other tablespace will remove the file immediately.

Regards,
Andreas

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #5
Andreas Pflug <pg*****@pse-consulting.de> writes:
I just reproduced this on win32. The file already exists, and is locked.


Oh, I'll bet it's the original copy of the table that hasn't been
removed yet. We may have an issue with SET TABLESPACE failing to close
the old file, so it can't be deleted yet on Windows ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Peter Jenny | last post by:
Hi NG what is the easiest way to move a table from one tablespace to another ? Thanks Peter
1
by: xixi | last post by:
There is one thing I don't understand, I have default tablespace userspace1 is database managed type, with total freepages 506048. another one called tmpxx is DMS type too, with 525120 free pages....
6
by: robert | last post by:
just got out of a "class" on EXPLAIN, from a 390/v6 maven. was told that ACCESSTYPE = 'R' in the plan_table meant a TableSpace scan. hmmmm. next step up (or down, depending on your outlook)...
2
by: db2dude | last post by:
Hello all, I have a database around 600GB and all tables were self-created by the application. Hence, we have only one huge SMS tablespace where all the tables are stored. To get better...
2
by: fuzzybr80 | last post by:
I am using MySQL 5.0 with a number of innodb tables whose ibdata files are growing quite quickly and filling up the /var partition (file is /var/mysql/ibdata1). Earlier on I followed instructions...
2
by: rAinDeEr | last post by:
Hi, I have Db2 9 installed in Windows. Am trying to create a table with the following DDL CREATE TABLE DB2N.T_CO ( a1 VARCHAR(100) NOT NULL, b1 VARCHAR(255), c1 VARCHAR(255), d1 ...
1
by: Sam Durai | last post by:
Env: DB2 v9.1 Server / Win XP. DB is enabled for Archival Logging. Was playing around with rebuild tablespace feature. My database 'CARD' has tablespace named t1,t2,t3. Taken couple of...
5
by: Troels Arvin | last post by:
Hello, Every so often, I'm asked to help people recover data from tables that were either dropped or where to much data was DELETEed. The complications related to restoring data are a problem....
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.