enable query cache (maybe default depends of the server configuration)
SELECT SQL_CACHE SUM(points) FROM account;
turn off mysql query cach
SELECT SQL_NO_CACHE SUM(points) FROM account;
enable query cache (maybe default depends of the server configuration)
SELECT SQL_CACHE SUM(points) FROM account;
turn off mysql query cach
SELECT SQL_NO_CACHE SUM(points) FROM account;
Bucardo is an asynchronous PostgreSQL replication system, allowing for both multi-master and multi-slave operations. It was developed at Backcountry.com by Jon Jensen and Greg Sabino Mullane of End Point Corporation, and is now in use at many other organizations.
ERROR: update or delete on table "page" violates foreign key constraint "info_page_id_fkey" on table "info" DETAIL: Key (page_id)=(106) is still referenced from table "info"
you have to drop cascade and recreating the new one.
psql> \d info
psql> alter table info drop constraint info_page_id_fkey;
psql> alter table info add constraint "info_page_id_fkey" foreign key(page_id) references page on delete cascade;
run command under user postgres
to backup
$pg_dumpall > db.sql
to restore
$psql -f db.sql template1
postgresql-8.3 available for etch on backports repositories. Add to /etc/apt/sources.list
deb http://www.backports.org/debian etch-backports main contrib non-free
then install postgresql-8.3
#apt-get -t etch-backports install postgresql-8.3
#pg_dropcluster --stop 8.3 main
#pg_upgradecluster 8.1 main
#pg_dropcluster --stop 8.1 main
#apt-get remove postgresql-8.1
read more
It is possible to invert the value in mysql table without knowing the present value. This working on mysql and may not work on postgresql.
UPDATE table_name SET column = NOT column
Prepared statement is one good way to avoid sql injection.
mysql> PREPARE stmt_name FROM "SELECT name FROM Country WHERE code = ?";
Query OK, 0 rows affected (0.09 sec)
Statement prepared
mysql> SET @test_parm = "FIN";
Query OK, 0 rows affected (0.00 sec)
mysql> EXECUTE stmt_name USING @test_parm;
+---------+
| name |
+---------+
| Finland |
+---------+
1 row in set (0.03 sec)
mysql> DEALLOCATE PREPARE stmt_name;
Query OK, 0 rows affected (0.00 sec)