Skip to content

Instantly share code, notes, and snippets.

View 3manuek's full-sized avatar
😎
tr3s.ma

Emanuel Calvo 3manuek

😎
tr3s.ma
View GitHub Profile
@3manuek
3manuek / gist:7164696
Last active December 26, 2015 14:19
According an error reported by HL, we tried to reproduce the error : > Last_Error: Error executing row event: 'Cannot execute > statement: impossible to write to binary log since statement is in row > format and BINLOG_FORMAT = STATEMENT.'
Step by step
============
pre-step) Version
mysql> select version();
+--------------------+
| version() |
+--------------------+
| 5.1.71-rel14.9-log |
+--------------------+
@3manuek
3manuek / gist:7233930
Last active December 26, 2015 23:58
Dump only views from a postgres database
#!/bin/bash
VIEWS="" ; for view in $(psql -U postgres -c 'select schemaname || $$.$$ ||viewname from pg_views where schemaname::text !~ $$information_schema|pg_catalog$$ ' -tA) ; do VIEWS="$VIEWS -t $view" ; done ; /opt/pg/bin/pg_dump -Upostgres -c -s $VIEWS
Optionally you can dump into a file:
VIEWS="" ; for view in $(psql -U postgres -c 'select schemaname || $$.$$ ||viewname from pg_views where schemaname::text !~ $$information_schema|pg_catalog$$ ' -tA) ; do VIEWS="$VIEWS -t $view" ; done ; /opt/pg/bin/pg_dump -Upostgres -c -s $VIEWS -f view_dump.sql
=====
#!/usr/local/bin/bash
@3manuek
3manuek / gist:9765751
Last active August 29, 2015 13:57
deparse_util debug and analysis
-- COMMANDS
CREATE VIEW barf (a) AS SELECT * from foo;
CREATE RECURSIVE VIEW barf_recursive (a) AS SELECT a from foo;
CREATE VIEW rebarf_baz (d) AS (SELECT d from baz) WITH CASCADED CHECK OPTION;
CREATE VIEW rebarf_sb (d) WITH (security_barrier=0) AS SELECT d from baz;
CREATE VIEW rebarf (a) WITH (security_barrier) AS SELECT a from foo ;
CREATE VIEW rebarf_2 (a) AS SELECT a from foo WITH LOCAL CHECK OPTION;
CREATE VIEW barf_check AS SELECT * FROM nyan WITH CHECK OPTION;
LOG: server process (PID 19793) was terminated by signal 9: Killed
DETAIL: Failed process was running: CREATE INDEX i_l_orderkey_quantity ON lineitem (l_orderkey, l_quantity);
LOG: terminating any other active server processes
connection to server was lost
WARNING: terminating connection because of crash of another server process
DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
HINT: In a moment you should be able to reconnect to the database and repeat your command.
WARNING: terminating connection because of crash of another server process
DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
HINT: In a moment you should be able to reconnect to the database and repeat your command.
@3manuek
3manuek / gist:10608417
Last active August 29, 2015 13:59
Errors from TPCh test
server signaled
LOG: received SIGHUP, reloading configuration files
LOG: parameter "checkpoint_segments" changed to "300"
LOG: parameter "checkpoint_timeout" changed to "3600s"
LOG: parameter "checkpoint_completion_target" changed to "0.9"
LOG: parameter "shared_buffers" cannot be changed without restarting the server
LOG: parameter "maintenance_work_mem" changed to "1GB"
LOG: configuration file "/AXLE/postgres/pgdata1GB/postgresql.conf" contains errors; unaffected changes were applied
TRUNCATE TABLE
TRUNCATE TABLE
make[3]: Entering directory `/root/event_trigger/2ndquadrant_bdr/src/backend/catalog'
cd ../../../src/include/catalog && '/usr/bin/perl' ./duplicate_oids
3567
3568
make[3]: *** [postgres.bki] Error 1
make[3]: Leaving directory `/root/event_trigger/2ndquadrant_bdr/src/backend/catalog'
make[2]: *** [submake-schemapg] Error 2
make[2]: Leaving directory `/root/event_trigger/2ndquadrant_bdr/src/backend'
make[1]: *** [all-backend-recurse] Error 2
make[1]: Leaving directory `/root/event_trigger/2ndquadrant_bdr/src'
root@precise64:~/event_trigger/2ndquadrant_bdr/src/test/regress# git diff serial_schedule
diff --git a/src/test/regress/serial_schedule b/src/test/regress/serial_schedule
index 16a1905..ad99e1b 100644
--- a/src/test/regress/serial_schedule
+++ b/src/test/regress/serial_schedule
@@ -1,5 +1,6 @@
# src/test/regress/serial_schedule
# This should probably be in an order similar to parallel_schedule.
+test: deparse_util
test: tablespace
insert OID = 3564 ( pg_event_trigger_get_creation_commands 11 10 12 10 100 0 0 f f f f t t s 0 0 2249 "" "{26,26,23,25,25,25,25,16,114}" "{o,o,o,o,o,o,o,o,o}" "{classid,objid,objsubid,command_tag,object_type,schema,identity,in_extension,command}" _null_ pg_event_trigger_get_creation_commands _null_ _null_ _null_ )
@3manuek
3manuek / gist:148dfb59a2043176439b
Created August 19, 2014 19:21
issue on initdb
sekondquad@axle:~/minmax15$ bin/initdb -D /data/sekondquad/AXLE/sekondquad/minmax15/
The files belonging to this database system will be owned by user "sekondquad".
This user must also own the server process.
initdb: invalid locale settings; check LANG and LC_* environment variables
sekondquad@axle:~/minmax15$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.