Re: [sqlite] Problem with rename table

2016-09-15 Thread Zsbán Ambrus
On Tue, Sep 6, 2016 at 3:37 PM, Radovan Antloga
 wrote:
> I can't find a solution how to fix my database after
> I have renamed table DOKUMENTI to DOKUMENTI2.
> Table DOKUMENTI had trigger dokumenti_trigger1
> and after renaming table I cant execute any sql. I forgot
> to drop trigger first. So now I always get error:
> malformed database schema (dokumenti_trigger1) -
> no such table main.dokumenti.

I wonder, in such a case, is it possible to temporarily disable
triggers with the sqlite3_db_config(db,
SQLITE_DBCONFIG_ENABLE_TRIGGER, 0, (int *)nullptr); call, then drop
that trigger, then re-enable triggers?  I haven't tried to see if this
works or not.

-- Ambrus
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with rename table

2016-09-14 Thread John McMahon

Thanks Scott for that explanation.

John


On 11/09/2016 01:27, Scott Robison wrote:

On Sep 10, 2016 2:54 AM, "John McMahon" <li...@jspect.fastmail.fm> wrote:


On 08/09/2016 10:09, Bob McFarlane wrote:


Please reply if you sent this. Thanks.



Hmm, looks like a fishing exercise to me. Same message in several threads.

This reply only to mailing list.


It's an anti-spam measure. Most spam will either not get the auto generated
message, or if it is a forgery the victim has a chance to disavow the
content.

I think it is too heavy handed a technique personally, but to each their
own.

I sent the sender an email letting him know that his anti-spam system was
spamming the crap out of the list and he fixed it. Easy peasy.



John






-Original Message-
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org]

On

Behalf Of Richard Hipp
Sent: Wednesday, September 7, 2016 7:49 PM
To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
Subject: Re: [sqlite] Problem with rename table

On 9/6/16, Radovan Antloga <radovan.antl...@siol.net> wrote:


Hi Richard !

I can't find a solution how to fix my database after I have renamed
table DOKUMENTI to DOKUMENTI2.
Table DOKUMENTI had trigger dokumenti_trigger1 and after renaming
table I cant execute any sql. I forgot to drop trigger first. So now I
always get error:
malformed database schema (dokumenti_trigger1) - no such table
main.dokumenti.



Rename the table back to its old name?

Worst case:  You can drop all the triggers like this:

   PRAGMA writable_schema=ON;
   DELETE FROM sqlite_master WHERE type='trigger';

Then close and reopen your database, and you have no more triggers.
The same will work for views.  But if you try the above with tables or
indexes, you'll end up with a database that fails "PRAGMA

integrity_check" -

though the corruption can be fixed with a VACUUM.
--
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



TMGID:S1141121912621011
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



--
Regards
   John McMahon
  li...@jspect.fastmail.fm



___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



--
Regards
   John McMahon
  li...@jspect.fastmail.fm


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with rename table

2016-09-10 Thread Scott Robison
On Sep 10, 2016 2:54 AM, "John McMahon" <li...@jspect.fastmail.fm> wrote:
>
> On 08/09/2016 10:09, Bob McFarlane wrote:
>>
>> Please reply if you sent this. Thanks.
>>
>
> Hmm, looks like a fishing exercise to me. Same message in several threads.
>
> This reply only to mailing list.

It's an anti-spam measure. Most spam will either not get the auto generated
message, or if it is a forgery the victim has a chance to disavow the
content.

I think it is too heavy handed a technique personally, but to each their
own.

I sent the sender an email letting him know that his anti-spam system was
spamming the crap out of the list and he fixed it. Easy peasy.

>
> John
>
>>
>>
>>
>>
>> -Original Message-
>> From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org]
On
>> Behalf Of Richard Hipp
>> Sent: Wednesday, September 7, 2016 7:49 PM
>> To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
>> Subject: Re: [sqlite] Problem with rename table
>>
>> On 9/6/16, Radovan Antloga <radovan.antl...@siol.net> wrote:
>>>
>>> Hi Richard !
>>>
>>> I can't find a solution how to fix my database after I have renamed
>>> table DOKUMENTI to DOKUMENTI2.
>>> Table DOKUMENTI had trigger dokumenti_trigger1 and after renaming
>>> table I cant execute any sql. I forgot to drop trigger first. So now I
>>> always get error:
>>> malformed database schema (dokumenti_trigger1) - no such table
>>> main.dokumenti.
>>
>>
>> Rename the table back to its old name?
>>
>> Worst case:  You can drop all the triggers like this:
>>
>>PRAGMA writable_schema=ON;
>>DELETE FROM sqlite_master WHERE type='trigger';
>>
>> Then close and reopen your database, and you have no more triggers.
>> The same will work for views.  But if you try the above with tables or
>> indexes, you'll end up with a database that fails "PRAGMA
integrity_check" -
>> though the corruption can be fixed with a VACUUM.
>> --
>> D. Richard Hipp
>> d...@sqlite.org
>> ___
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>
>>
>>
>> TMGID:S1141121912621011
>> ___
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>
>
> --
> Regards
>John McMahon
>   li...@jspect.fastmail.fm
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with rename table

2016-09-10 Thread John McMahon



On 08/09/2016 10:09, Bob McFarlane wrote:

Please reply if you sent this. Thanks.



Hmm, looks like a fishing exercise to me. Same message in several threads.

This reply only to mailing list.

John





-Original Message-
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On
Behalf Of Richard Hipp
Sent: Wednesday, September 7, 2016 7:49 PM
To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
Subject: Re: [sqlite] Problem with rename table

On 9/6/16, Radovan Antloga <radovan.antl...@siol.net> wrote:

Hi Richard !

I can't find a solution how to fix my database after I have renamed
table DOKUMENTI to DOKUMENTI2.
Table DOKUMENTI had trigger dokumenti_trigger1 and after renaming
table I cant execute any sql. I forgot to drop trigger first. So now I
always get error:
malformed database schema (dokumenti_trigger1) - no such table
main.dokumenti.


Rename the table back to its old name?

Worst case:  You can drop all the triggers like this:

   PRAGMA writable_schema=ON;
   DELETE FROM sqlite_master WHERE type='trigger';

Then close and reopen your database, and you have no more triggers.
The same will work for views.  But if you try the above with tables or
indexes, you'll end up with a database that fails "PRAGMA integrity_check" -
though the corruption can be fixed with a VACUUM.
--
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



TMGID:S1141121912621011
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



--
Regards
   John McMahon
  li...@jspect.fastmail.fm


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with rename table

2016-09-09 Thread Radovan Antloga

Yes my first idea was to rename back to old name
but you cant because every sql fails with error
malformed database schema. Interest thing is that
sql Richard suggested works and no error message
returned. It looks like triggers are parsed when
other sql executed and produce error.
I found another solution and just edited with
good hex editor and change trigger definition
(rename table). I could to that without changing
size I just replace last space character with
2 so I get dokumenti2 table name. Mybe this can
be fauture request that when table is renamed
also trigger that belong to this table should
get table renamed.

Best Regards
Radovan

Bob McFarlane je 08.09.2016 ob 2:09 napisal:

Please reply if you sent this. Thanks.





-Original Message-
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On
Behalf Of Richard Hipp
Sent: Wednesday, September 7, 2016 7:49 PM
To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
Subject: Re: [sqlite] Problem with rename table

On 9/6/16, Radovan Antloga <radovan.antl...@siol.net> wrote:

Hi Richard !

I can't find a solution how to fix my database after I have renamed
table DOKUMENTI to DOKUMENTI2.
Table DOKUMENTI had trigger dokumenti_trigger1 and after renaming
table I cant execute any sql. I forgot to drop trigger first. So now I
always get error:
malformed database schema (dokumenti_trigger1) - no such table
main.dokumenti.

Rename the table back to its old name?

Worst case:  You can drop all the triggers like this:

PRAGMA writable_schema=ON;
DELETE FROM sqlite_master WHERE type='trigger';

Then close and reopen your database, and you have no more triggers.
The same will work for views.  But if you try the above with tables or
indexes, you'll end up with a database that fails "PRAGMA integrity_check" -
though the corruption can be fixed with a VACUUM.
--
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



TMGID:S1141121912621011
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with rename table

2016-09-07 Thread Bob McFarlane
Please reply if you sent this. Thanks.





-Original Message-
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On
Behalf Of Richard Hipp
Sent: Wednesday, September 7, 2016 7:49 PM
To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
Subject: Re: [sqlite] Problem with rename table

On 9/6/16, Radovan Antloga <radovan.antl...@siol.net> wrote:
> Hi Richard !
>
> I can't find a solution how to fix my database after I have renamed
> table DOKUMENTI to DOKUMENTI2.
> Table DOKUMENTI had trigger dokumenti_trigger1 and after renaming
> table I cant execute any sql. I forgot to drop trigger first. So now I
> always get error:
> malformed database schema (dokumenti_trigger1) - no such table
> main.dokumenti.

Rename the table back to its old name?

Worst case:  You can drop all the triggers like this:

   PRAGMA writable_schema=ON;
   DELETE FROM sqlite_master WHERE type='trigger';

Then close and reopen your database, and you have no more triggers.
The same will work for views.  But if you try the above with tables or
indexes, you'll end up with a database that fails "PRAGMA integrity_check" -
though the corruption can be fixed with a VACUUM.
--
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



TMGID:S1141121912621011
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with rename table

2016-09-07 Thread Bob McFarlane
Please reply if you sent this. Thanks.





-Original Message-
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On
Behalf Of Radovan Antloga
Sent: Tuesday, September 6, 2016 9:37 AM
To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
Subject: [sqlite] Problem with rename table

Hi Richard !

I can't find a solution how to fix my database after I have renamed table
DOKUMENTI to DOKUMENTI2.
Table DOKUMENTI had trigger dokumenti_trigger1 and after renaming table I
cant execute any sql. I forgot to drop trigger first. So now I always get
error:
malformed database schema (dokumenti_trigger1) - no such table
main.dokumenti.

TIA
Radovan Antloga
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



TMGID:S1141121912621019
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with rename table

2016-09-07 Thread Richard Hipp
On 9/6/16, Radovan Antloga  wrote:
> Hi Richard !
>
> I can't find a solution how to fix my database after
> I have renamed table DOKUMENTI to DOKUMENTI2.
> Table DOKUMENTI had trigger dokumenti_trigger1
> and after renaming table I cant execute any sql. I forgot
> to drop trigger first. So now I always get error:
> malformed database schema (dokumenti_trigger1) -
> no such table main.dokumenti.

Rename the table back to its old name?

Worst case:  You can drop all the triggers like this:

   PRAGMA writable_schema=ON;
   DELETE FROM sqlite_master WHERE type='trigger';

Then close and reopen your database, and you have no more triggers.
The same will work for views.  But if you try the above with tables or
indexes, you'll end up with a database that fails "PRAGMA
integrity_check" - though the corruption can be fixed with a VACUUM.
-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Problem with rename table

2016-09-07 Thread Radovan Antloga

Hi Richard !

I can't find a solution how to fix my database after
I have renamed table DOKUMENTI to DOKUMENTI2.
Table DOKUMENTI had trigger dokumenti_trigger1
and after renaming table I cant execute any sql. I forgot
to drop trigger first. So now I always get error:
malformed database schema (dokumenti_trigger1) -
no such table main.dokumenti.

TIA
Radovan Antloga
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users