This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop function if exists insert_test_data(bigint,bigint,bigint); | |
create or replace function insert_test_data(bigint,bigint,bigint) returns void as $$ | |
declare | |
seq_start bigint := $1; | |
seq_end bigint := $2; | |
interval constant bigint := $3; | |
step bigint := interval; | |
begin | |
while (seq_start - 1) != seq_end loop | |
insert into products select |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace function delete_test_data(chunk int,sleep int) returns void as $$ | |
declare | |
chunk int := $1; | |
sleep_interval int := $2; | |
deleted_rows int; | |
begin | |
while dele |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
vars: | |
userlist_file: /etc/pgbouncer/userlist.txt | |
userlist_owner: postgres | |
remote_user: root | |
tasks: | |
- name: "Stage 1: create temporary userlist.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
vars: | |
postgresql_datadir: /var/lib/pgsql/9.4-bdr/data | |
postgresql_upstream: 192.168.122.12 | |
postgresql_downstream: 192.168.122.13 | |
postgresql_bdr_database: bdrdemo | |
postgresql_admin_user: postgres | |
postgresql_shared_guc: | |
- { regexp: "^#?listen_addresses = .*$", guc: "listen_addresses = '*'" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
vars: | |
postgresql_roles: | |
- { rolname: "anovikov", privileges: "LOGIN,CREATEROLE,CREATEDB", password: "qwerty" } | |
- { rolname: "vpupkin", privileges: "LOGIN", password: "12345" } | |
remote_user: root | |
tasks: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main (void) { | |
int n = 0; | |
while (1) { | |
if (malloc(1<<20) == NULL) { | |
printf("malloc failure after %d MiB\n", n); | |
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <sys/mman.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <unistd.h> | |
#define DEFSZ 0x10000 | |
static void *glob_var; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* use -lpthread when build. | |
*/ | |
#include <semaphore.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <sys/mman.h> | |
#include <sys/types.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
void doit(int ** s , int row, int col) | |
{ | |
int i, j; | |
for (i = 0; i < row; i++){ | |
for (j = 0 ;j < col; j++) | |
printf("%d ", s[i][j]); | |
printf("\n"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
int n_rows = 10, n_cols = 20, tup_size=64; | |
char ***z; | |
z = malloc(n_rows * sizeof(char **)); | |
assert(z != NULL); |
OlderNewer