Apparently, and unfortunately not...

using pragma temp_store_directory; returns nothing if it is not 
explicitly set.  In this case you know that sqlite will then "search for 
best option...  It would be great if the pragma returned what it is 
going to use even if it wasn't explicitly set.

I know that for example, in linux, if temp_store_directory is not set, 
then it checks for the common temp environment variables, failing that, 
it then tries some standard hard coded directories ('/tmp','/var/tmp' 
...)  If all that turns up nothing then it finally settles on the 
current directory.

You run into problems when the directory it uses is not writable for the 
user the process is running under.

FYI, in a previous posting, I discovered that even if you set temp_store 
to memory only, you still need a temp_store_directory that is writable. 
  I can't recall specifically, but there is one temp file that is always 
on disk regardless of settings.
Kinda makes the whole memory only temp_store useless.


Robert Citek wrote:
> On Thu, Jan 7, 2010 at 12:54 PM, Kris Groves<kris.gro...@mmlab.de>  wrote:
>> So it seems as if TMPDIR will work in two different OSes.
>
> What would be an easy test to verify if setting TMPDIR works or not?
>
> I did this, which shows that TMPDIR is indeed being used, but I think
> this test is a bit cumbersome:
>
> $ sqlite3 /dev/null
> SQLite version 3.6.10
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite>  create temp table foo (bar int) ;
> sqlite>
> [1]+  Stopped                 sqlite3 /dev/null
>
> $ ls -l /proc/$(jobs -p %1)/fd
> total 0
> lrwx------ 1 rwcitek rwcitek 64 2010-01-07 13:29 0 ->  /dev/pts/0
> lrwx------ 1 rwcitek rwcitek 64 2010-01-07 13:29 1 ->  /dev/pts/0
> lrwx------ 1 rwcitek rwcitek 64 2010-01-07 13:29 2 ->  /dev/pts/0
> lrwx------ 1 rwcitek rwcitek 64 2010-01-07 13:29 3 ->  /dev/null
> lrwx------ 1 rwcitek rwcitek 64 2010-01-07 13:29 4 ->
> /var/tmp/etilqs_4GCNtDifceoskIh (deleted)
> lrwx------ 1 rwcitek rwcitek 64 2010-01-07 13:29 5 ->
> /var/tmp/etilqs_dy4Trta7FQrYQT8 (deleted)
>
> $ fg
> sqlite3 /dev/null
> .q
>
> $ TMPDIR=/dev/shm/ sqlite3 /dev/null
> SQLite version 3.6.10
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite>  create temp table foo (bar int) ;
> sqlite>
> [1]+  Stopped                 TMPDIR=/dev/shm/ sqlite3 /dev/null
>
> $ ls -l /proc/$(jobs -p %1)/fd
> total 0
> lrwx------ 1 rwcitek rwcitek 64 2010-01-07 13:33 0 ->  /dev/pts/0
> lrwx------ 1 rwcitek rwcitek 64 2010-01-07 13:33 1 ->  /dev/pts/0
> lrwx------ 1 rwcitek rwcitek 64 2010-01-07 13:33 2 ->  /dev/pts/0
> lrwx------ 1 rwcitek rwcitek 64 2010-01-07 13:33 3 ->  /dev/null
> lrwx------ 1 rwcitek rwcitek 64 2010-01-07 13:33 4 ->
> /dev/shm/etilqs_MOz4R9xoAMB1i6U (deleted)
> lrwx------ 1 rwcitek rwcitek 64 2010-01-07 13:33 5 ->
> /dev/shm/etilqs_IXXkIEReSwGcwL5 (deleted)
>
> $ fg
> TMPDIR=/dev/shm/ sqlite3 /dev/null
> .q
>
> Regards,
> - Robert
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to