Is the table created by "create temp table" in the database file or in memory?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Is the table created by "create temp table" in the database file or in memory?

Peng Yu
Hi,

https://www.sqlite.org/lang_createtable.html

"The database in which the new table is created. Tables may be created
in the main database, the temp database, or in any attached database."

It is not clear to me in the doc. If a table is created by "create
temp table", is it temporarily a database file but later got deleted
upon termination of the sqlite3 session? Or it is in memory? Thanks.

--
Regards,
Peng
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Is the table created by "create temp table" in the database file or in memory?

Simon Slavin-3
On 1 Feb 2020, at 1:30pm, Peng Yu <[hidden email]> wrote:

> https://www.sqlite.org/lang_createtable.html
>
> "The database in which the new table is created. Tables may be created in the main database, the temp database, or in any attached database."
>
> It is not clear to me in the doc. If a table is created by "create
> temp table", is it temporarily a database file but later got deleted
> upon termination of the sqlite3 session? Or it is in memory? Thanks.

Further down the same page:

" If the "TEMP" or "TEMPORARY" keyword occurs between the "CREATE" and "TABLE" then the new table is created in the temp database. "
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Is the table created by "create temp table" in the database file or in memory?

Peng Yu
But it doesn't explain what is "the temp database". Is it an actual
database file? Or it is just a in-memory database?

On 2/1/20, Simon Slavin <[hidden email]> wrote:

> On 1 Feb 2020, at 1:30pm, Peng Yu <[hidden email]> wrote:
>
>> https://www.sqlite.org/lang_createtable.html
>>
>> "The database in which the new table is created. Tables may be created in
>> the main database, the temp database, or in any attached database."
>>
>> It is not clear to me in the doc. If a table is created by "create
>> temp table", is it temporarily a database file but later got deleted
>> upon termination of the sqlite3 session? Or it is in memory? Thanks.
>
> Further down the same page:
>
> " If the "TEMP" or "TEMPORARY" keyword occurs between the "CREATE" and
> "TABLE" then the new table is created in the temp database. "
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


--
Regards,
Peng
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Is the table created by "create temp table" in the database file or in memory?

J. King-3
On February 1, 2020 10:03:28 a.m. EST, Peng Yu <[hidden email]> wrote:
>But it doesn't explain what is "the temp database". Is it an actual
>database file? Or it is just a in-memory database?


It depends. See <https://sqlite.org/pragma.html#pragma_temp_store> for details ans links to further reading.
--
J. King
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Is the table created by "create temp table" in the database file or in memory?

sub sk79
Also these links which maybe easier to grok:
https://sqlite.org/tempfiles.html
<https://sqlite.org/tempfiles.html#tempstore> (sections  2.6 and 3)
https://sqlite.org/tempfiles.html#tempstore

-Neal

On Sat, Feb 1, 2020 at 10:09 AM J. King <[hidden email]> wrote:

> On February 1, 2020 10:03:28 a.m. EST, Peng Yu <[hidden email]>
> wrote:
> >But it doesn't explain what is "the temp database". Is it an actual
> >database file? Or it is just a in-memory database?
>
>
> It depends. See <https://sqlite.org/pragma.html#pragma_temp_store> for
> details ans links to further reading.
> --
> J. King
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users