Pivotal Knowledge Base


CREATE TABLE fails with "ERROR: could not create temporary file" in Pivotal HDB


Product Version
Pivotal HD/HDB 1.x/2.x


When trying to run SQL in Pivotal HDB, the following error is displayed:

gpadmin=# create table test (id integer);
ERROR: could not create temporary file "pgsql_tmp/pgsql_tmp_sess37_w241398_combocid_map.0001": No such file or directory (fd.c:1221)


The user running the SQL does not have access to the temporary working directory on the master or the directory does not exist.  


1. Log into Ambari. 

2. Locate the configuration setting "hawq_master_temp_directory" and take note of the value. For example, in this case, it is /tmp/hawq/master:

3. Log into the HAWQ master via SSH.

4. Confirm that the directory exists, that the permissions are correct, and that the user running the SQL has read/write access to the directory:

[gpadmin@hawq20 ~]$ ls -ltrd /tmp/hawq/master/
drwxr-xr-x. 3 gpadmin gpadmin 4096 Jun 4 01:37 /tmp/hawq/master/
[gpadmin@hawq20 ~]$

Note: to create the directory and set the correct permissions, the following commands can be run:

mkdir -p /tmp/hawq/master
chown gpadmin:gpadmin /tmp/hawq/master
chmod 755 /tmp/hawq/master/




Powered by Zendesk