Skip to content

Instantly share code, notes, and snippets.

@frozenfoxx
Last active September 29, 2017 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frozenfoxx/05cb345472518b618cf39edb227c660d to your computer and use it in GitHub Desktop.
Save frozenfoxx/05cb345472518b618cf39edb227c660d to your computer and use it in GitHub Desktop.
Development for the docker-schemaverse container
devbox:docker-schemaverse frozenfoxx$ docker run -it -p 5432:5432 frozenfoxx/docker-schemaverse:latest
* Starting PostgreSQL 9.5 database server [ OK ]
2017-09-29 15:44:51 UTC [37-2] LOG: received fast shutdown request
2017-09-29 15:44:51 UTC [37-3] LOG: aborting any active transactions
2017-09-29 15:44:51 UTC [42-2] LOG: autovacuum launcher shutting down
2017-09-29 15:44:51 UTC [39-1] LOG: shutting down
2017-09-29 15:44:53 UTC [39-2] LOG: database system is shut down
2017-09-29 16:00:59 UTC [27-1] LOG: database system was shut down at 2017-09-29 15:44:53 UTC
2017-09-29 16:00:59 UTC [27-2] LOG: MultiXact member wraparound protections are now enabled
2017-09-29 16:00:59 UTC [26-1] LOG: database system is ready to accept connections
2017-09-29 16:00:59 UTC [31-1] LOG: autovacuum launcher started
2017-09-29 16:01:00 UTC [33-1] [unknown]@[unknown] LOG: incomplete startup packet
[...]
2017-09-29 20:26:27 UTC [136-1] schemaverse@schemaverse ERROR: permission denied for relation variable
2017-09-29 20:26:27 UTC [136-2] schemaverse@schemaverse CONTEXT: SQL statement "SELECT char_value FROM variable WHERE name = variable_name and player_id=0"
PL/pgSQL function get_char_variable(character varying) line 6 at SQL statement
PL/pgSQL function round_control() line 13 at IF
2017-09-29 20:26:27 UTC [136-3] schemaverse@schemaverse STATEMENT: SELECT ROUND_CONTROL();
2017-09-29 20:26:27 UTC [136-4] schemaverse@schemaverse ERROR: permission denied for relation ship
2017-09-29 20:26:27 UTC [136-5] schemaverse@schemaverse STATEMENT:
BEGIN WORK;
LOCK TABLE ship, ship_control IN EXCLUSIVE MODE;
SELECT MOVE_SHIPS();
COMMIT WORK;
2017-09-29 20:26:27 UTC [136-6] schemaverse@schemaverse ERROR: current transaction is aborted, commands ignored until end of transaction block
2017-09-29 20:26:27 UTC [136-7] schemaverse@schemaverse STATEMENT:
SELECT
player.id as player_id,
player.username as username,
fleet.id as fleet_id,
player.error_channel as error_channel
FROM
fleet, player
WHERE
fleet.player_id=player.id
AND
fleet.enabled='t'
AND
fleet.runtime > '0 minutes'::interval
ORDER BY
player.username;
2017-09-29 20:26:27 UTC [136-8] schemaverse@schemaverse ERROR: current transaction is aborted, commands ignored until end of transaction block
2017-09-29 20:26:27 UTC [136-9] schemaverse@schemaverse STATEMENT:
BEGIN WORK;
LOCK TABLE ship, ship_control IN EXCLUSIVE MODE;
SELECT
CASE
WHEN ship_control.action = 'ATTACK' THEN ATTACK(ship.id, ship_control.action_target_id)::integer
WHEN ship_control.action = 'REPAIR' THEN REPAIR(ship.id, ship_control.action_target_id)::integer
WHEN ship_control.action = 'MINE' THEN MINE(ship.id, ship_control.action_target_id)::integer
ELSE NULL END
FROM
ship, ship_control
WHERE
ship.id = ship_control.ship_id
AND
ship_control.action IS NOT NULL
AND
ship_control.action_target_id IS NOT NULL
AND
ship.destroyed='f'
AND
ship.last_action_tic != (SELECT last_value FROM tic_seq);
COMMIT WORK;
2017-09-29 20:26:27 UTC [136-10] schemaverse@schemaverse ERROR: current transaction is aborted, commands ignored until end of transaction block
2017-09-29 20:26:27 UTC [136-11] schemaverse@schemaverse STATEMENT: lock table planet_miners;SELECT perform_mining();
2017-09-29 20:26:27 UTC [136-12] schemaverse@schemaverse ERROR: current transaction is aborted, commands ignored until end of transaction block
2017-09-29 20:26:27 UTC [136-13] schemaverse@schemaverse STATEMENT: UPDATE planet SET fuel=fuel+1000000 WHERE id in (select id from planet where fuel < 10000000 order by RANDOM() LIMIT 5000);
2017-09-29 20:26:27 UTC [136-14] schemaverse@schemaverse ERROR: current transaction is aborted, commands ignored until end of transaction block
2017-09-29 20:26:27 UTC [136-15] schemaverse@schemaverse STATEMENT: BEGIN WORK;
LOCK TABLE ship, ship_control IN EXCLUSIVE MODE;
create temp table t_ship_updates (id integer, current_health integer, future_health integer, max_health integer, last_living_tic integer, destroyed boolean, player_id integer);
insert into t_ship_updates (id, current_health, future_health, max_health, last_living_tic, destroyed, player_id)
select id, current_health, future_health, max_health, last_living_tic, destroyed, player_id
from ship;
UPDATE t_ship_updates SET current_health=max_health WHERE future_health >= max_health and current_health <> max_health;
UPDATE t_ship_updates SET current_health=future_health WHERE future_health between 0 and max_health and current_health <> max_health;
UPDATE t_ship_updates SET current_health=0 WHERE future_health < 0 and current_health <> 0;
UPDATE t_ship_updates SET last_living_tic=(SELECT last_value FROM tic_seq) WHERE current_health > 0;
UPDATE t_ship_updates SET destroyed='t' WHERE ((SELECT last_value FROM tic_seq)-last_living_tic)>GET_NUMERIC_VARIABLE('EXPLODED') and player_id > 0;
create index t_id on t_ship_updates (id);
update ship s
set current_health = (select current_health from t_ship_updates where id = s.id),
last_living_tic = (select last_living_tic from t_ship_updates where id = s.id),
destroyed = (select destroyed from t_ship_updates where id = s.id);
cluster ship_pkey on ship;
COMMIT WORK;
2017-09-29 20:26:27 UTC [136-16] schemaverse@schemaverse ERROR: current transaction is aborted, commands ignored until end of transaction block
2017-09-29 20:26:27 UTC [136-17] schemaverse@schemaverse STATEMENT: vacuum ship;
2017-09-29 20:26:27 UTC [136-18] schemaverse@schemaverse ERROR: current transaction is aborted, commands ignored until end of transaction block
2017-09-29 20:26:27 UTC [136-19] schemaverse@schemaverse STATEMENT: INSERT INTO event(player_id_1, action, tic, public) VALUES(0,'TIC',(SELECT last_value FROM tic_seq),'t')
2017-09-29 20:26:27 UTC [136-20] schemaverse@schemaverse ERROR: current transaction is aborted, commands ignored until end of transaction block
2017-09-29 20:26:27 UTC [136-21] schemaverse@schemaverse STATEMENT: SELECT nextval('tic_seq')
[...]
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
host schemaverse +players ::/0 md5
host schemaverse +players 0.0.0.0/0 md5
DBD::Pg::db do failed: ERROR: permission denied for relation variable
CONTEXT: SQL statement "SELECT char_value FROM variable WHERE name = variable_name and player_id=0"
PL/pgSQL function get_char_variable(character varying) line 6 at SQL statement
PL/pgSQL function round_control() line 13 at IF at /src/schemaverse/tic.pl line 50.
DBD::Pg::db do failed: ERROR: permission denied for relation ship at /src/schemaverse/tic.pl line 60.
DBD::Pg::st execute failed: ERROR: current transaction is aborted, commands ignored until end of transaction block at /src/schemaverse/tic.pl line 83.
DBD::Pg::st fetchrow failed: no statement executing at /src/schemaverse/tic.pl line 86.
DBD::Pg::db do failed: ERROR: current transaction is aborted, commands ignored until end of transaction block at /src/schemaverse/tic.pl line 136.
DBD::Pg::db do failed: ERROR: current transaction is aborted, commands ignored until end of transaction block at /src/schemaverse/tic.pl line 138.
DBD::Pg::db do failed: ERROR: current transaction is aborted, commands ignored until end of transaction block at /src/schemaverse/tic.pl line 141.
DBD::Pg::db do failed: ERROR: current transaction is aborted, commands ignored until end of transaction block at /src/schemaverse/tic.pl line 144.
DBD::Pg::db do failed: ERROR: current transaction is aborted, commands ignored until end of transaction block at /src/schemaverse/tic.pl line 163.
DBD::Pg::db do failed: ERROR: current transaction is aborted, commands ignored until end of transaction block at /src/schemaverse/tic.pl line 169.
DBD::Pg::db do failed: ERROR: current transaction is aborted, commands ignored until end of transaction block at /src/schemaverse/tic.pl line 172.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment