Scope of local temporary tables
Hi all, I was wondering if I could clarify something about the scope of local temporary tables in MonetDB. I imagined that these would be local to a single client session but it seems that I am wrong about this. If I execute the following Python script multiple times in succession, it fails as the table name is already in use. import monetdb.sql import sys dbh = monetdb.sql.Connection(port=int(sys.argv[1]),database=sys.argv[2],hostname=sys.argv[3],autocommit=True) cursor = dbh.cursor() cursor.execute('create local temporary table input (term int, p float) on commit preserve rows;'); cursor.execute('insert into input values ( 1,0.1);'); cursor.execute('select * from input;'); print(cursor.fetchall()) dbh.close() How is the local temporary table different from a normal table in this case? Best regards, Alastair
On 2014-04-04 18:14, Alastair McKinley wrote:
Hi all,
I was wondering if I could clarify something about the scope of local temporary tables in MonetDB. I imagined that these would be local to a single client session but it seems that I am wrong about this.
If I execute the following Python script multiple times in succession, it fails as the table name is already in use.
import monetdb.sql import sys
dbh = monetdb.sql.Connection(port=int(sys.argv[1]),database=sys.argv[2],hostname=sys.argv[3],autocommit=True) cursor = dbh.cursor()
cursor.execute('create local temporary table input (term int, p float) on commit preserve rows;'); cursor.execute('insert into input values ( 1,0.1);'); cursor.execute('select * from input;'); print(cursor.fetchall())
dbh.close()
How is the local temporary table different from a normal table in this case?
Looks like a bug to me. The table is not visible in sys.tables after starting a new session but the server still complains that the table already exists.
Best regards,
Alastair
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- Sjoerd Mullender
Can I file a bug report for this? -----Original Message----- From: users-list [mailto:users-list-bounces+a.mckinley=analyticsengines.com@monetdb.org] On Behalf Of Sjoerd Mullender Sent: 04 April 2014 17:37 To: users-list@monetdb.org Subject: Re: Scope of local temporary tables On 2014-04-04 18:14, Alastair McKinley wrote:
Hi all,
I was wondering if I could clarify something about the scope of local temporary tables in MonetDB. I imagined that these would be local to a single client session but it seems that I am wrong about this.
If I execute the following Python script multiple times in succession, it fails as the table name is already in use.
import monetdb.sql import sys
dbh = monetdb.sql.Connection(port=int(sys.argv[1]),database=sys.argv[2],hostname=sys.argv[3],autocommit=True) cursor = dbh.cursor()
cursor.execute('create local temporary table input (term int, p float) on commit preserve rows;'); cursor.execute('insert into input values ( 1,0.1);'); cursor.execute('select * from input;'); print(cursor.fetchall())
dbh.close()
How is the local temporary table different from a normal table in this case?
Looks like a bug to me. The table is not visible in sys.tables after starting a new session but the server still complains that the table already exists.
Best regards,
Alastair
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- Sjoerd Mullender
On 2014-04-05 20:16, Alastair McKinley wrote:
Can I file a bug report for this?
Yes, of course you can. In fact, please do.
-----Original Message----- From: users-list [mailto:users-list-bounces+a.mckinley=analyticsengines.com@monetdb.org] On Behalf Of Sjoerd Mullender Sent: 04 April 2014 17:37 To: users-list@monetdb.org Subject: Re: Scope of local temporary tables
On 2014-04-04 18:14, Alastair McKinley wrote:
Hi all,
I was wondering if I could clarify something about the scope of local temporary tables in MonetDB. I imagined that these would be local to a single client session but it seems that I am wrong about this.
If I execute the following Python script multiple times in succession, it fails as the table name is already in use.
import monetdb.sql import sys
dbh = monetdb.sql.Connection(port=int(sys.argv[1]),database=sys.argv[2],hostname=sys.argv[3],autocommit=True) cursor = dbh.cursor()
cursor.execute('create local temporary table input (term int, p float) on commit preserve rows;'); cursor.execute('insert into input values ( 1,0.1);'); cursor.execute('select * from input;'); print(cursor.fetchall())
dbh.close()
How is the local temporary table different from a normal table in this case?
Looks like a bug to me. The table is not visible in sys.tables after starting a new session but the server still complains that the table already exists.
Best regards,
Alastair
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- Sjoerd Mullender
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- Sjoerd Mullender
participants (2)
-
Alastair McKinley
-
Sjoerd Mullender