You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bhuvaneswaran A <bh...@collab.net> on 2009/10/09 18:34:26 UTC
wc-ng: using backup tables ...
I've 2 queries related to wc-ng related sqls defined in wc-metadata.sql
file:
1) We create backup tables explicitly to store records from original
tables. We use the sqls in following style:
create table foo_temp (col1 int);
insert into foo_temp select col1 from foo;
drop table foo;
create table foo (col1 int);
insert into foo select col1 from foo_temp;
drop table foo_temp;
Instead, why shouldn't use the following style:
create table foo_temp as select col1 from foo;
drop table foo;
create table foo (col1 int);
insert into foo select col1 from foo_temp;
drop table foo_temp;
2) We use 2 backup tables, BASE_NODE_BACKUP and ACTUAL_NODE_BACKUP. The
former is defined as a TEMPORARY table, while the latter is defined as
normal table. Any specific reason for doing so? Why can't they maintain
same standard, perhaps being a TEMPORARY table?
If you agree with the proposals, I shall come with a patch. Thanks!
--
Bhuvaneswaran A
CollabNet Software P Ltd. | www.collab.net
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2405630
Re: wc-ng: using backup tables ...
Posted by "Hyrum K. Wright" <hy...@hyrumwright.org>.
On Oct 9, 2009, at 1:39 PM, Greg Stein wrote:
> On Fri, Oct 9, 2009 at 14:34, Bhuvaneswaran A <bh...@collab.net>
> wrote:
>> I've 2 queries related to wc-ng related sqls defined in wc-
>> metadata.sql
>> file:
>>
>> 1) We create backup tables explicitly to store records from original
>> tables. We use the sqls in following style:
>> create table foo_temp (col1 int);
>> insert into foo_temp select col1 from foo;
>> drop table foo;
>> create table foo (col1 int);
>> insert into foo select col1 from foo_temp;
>> drop table foo_temp;
>>
>> Instead, why shouldn't use the following style:
>> create table foo_temp as select col1 from foo;
>> drop table foo;
>> create table foo (col1 int);
>> insert into foo select col1 from foo_temp;
>> drop table foo_temp;
>
> That seems fine. Maybe Hyrum didn't know a table could be created
> that way.
This may be possible; I was just following the recipe given by http://sqlite.org/faq.html#q11
>> 2) We use 2 backup tables, BASE_NODE_BACKUP and ACTUAL_NODE_BACKUP.
>> The
>> former is defined as a TEMPORARY table, while the latter is defined
>> as
>> normal table. Any specific reason for doing so? Why can't they
>> maintain
>> same standard, perhaps being a TEMPORARY table?
>
> Yah, they should probably both be TEMPORARY.
Agreed.
-Hyrum
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2406711
Re: wc-ng: using backup tables ...
Posted by Greg Stein <gs...@gmail.com>.
On Fri, Oct 9, 2009 at 14:34, Bhuvaneswaran A <bh...@collab.net> wrote:
> I've 2 queries related to wc-ng related sqls defined in wc-metadata.sql
> file:
>
> 1) We create backup tables explicitly to store records from original
> tables. We use the sqls in following style:
> create table foo_temp (col1 int);
> insert into foo_temp select col1 from foo;
> drop table foo;
> create table foo (col1 int);
> insert into foo select col1 from foo_temp;
> drop table foo_temp;
>
> Instead, why shouldn't use the following style:
> create table foo_temp as select col1 from foo;
> drop table foo;
> create table foo (col1 int);
> insert into foo select col1 from foo_temp;
> drop table foo_temp;
That seems fine. Maybe Hyrum didn't know a table could be created that way.
> 2) We use 2 backup tables, BASE_NODE_BACKUP and ACTUAL_NODE_BACKUP. The
> former is defined as a TEMPORARY table, while the latter is defined as
> normal table. Any specific reason for doing so? Why can't they maintain
> same standard, perhaps being a TEMPORARY table?
Yah, they should probably both be TEMPORARY.
Cheers,
-g
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2405633