This file contains hidden or 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
postgres=# \i /tests/single.sql | |
Going to single user mode | |
waiting for server to shut down...2019-03-05 07:25:44.650 UTC [108] LOG: received fast shutdown request | |
.2019-03-05 07:25:44.652 UTC [108] LOG: aborting any active transactions | |
2019-03-05 07:25:44.653 UTC [116] FATAL: terminating connection due to administrator command | |
2019-03-05 07:25:44.665 UTC [108] LOG: background worker "logical replication launcher" (PID 115) exited with exit code 1 | |
2019-03-05 07:25:44.665 UTC [110] LOG: shutting down | |
2019-03-05 07:25:44.693 UTC [108] LOG: database system is shut down | |
done | |
server stopped |
This file contains hidden or 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
michel@chrx:~/dev/pggraphblas$ ./test.sh | |
force rm previous container | |
Error: No such container: pggraphblas-test-db | |
building test image | |
Sending build context to Docker daemon 422.9kB | |
Step 1/9 : FROM postgres:11 | |
---> f9b577fb1ed6 | |
Step 2/9 : RUN apt-get update && apt-get install -y make cmake git postgresql-server-dev-11 postgresql-11-pgtap postgresql-11-dbgsym curl build-essential m4 sudo gdb | |
---> Using cache | |
---> 719990842ff4 |
This file contains hidden or 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
psql (11.1 (Debian 11.1-1.pgdg90+1)) | |
Type "help" for help. | |
postgres=# \i test.sql | |
CREATE EXTENSION | |
CREATE EXTENSION | |
CREATE TABLE | |
INSERT 0 10 | |
CREATE FUNCTION |
This file contains hidden or 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
select (regexp_matches(substring(query from 41), E'\"([a-z_]*)\"'))[1] as endpoint, | |
sum(calls) as calls, | |
sum(total_time) as total_time_ms, | |
avg(mean_time) as mean_time_ms, | |
avg(stddev_time) as stddev_time_ms, | |
sum(shared_blks_hit) as shared_blks_hit, | |
sum(shared_blks_read) as shared_blks_read, | |
sum(shared_blks_dirtied) as shared_blks_dirtied | |
from admin.pg_stat_statements() | |
where query ilike '%_postgrest_t%' |
This file contains hidden or 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
# Minimal example of getting a PostgREST API running from scratch for | |
# testing purposes. It uses docker to launch a postgres database and | |
# a postgrest api server. | |
# This should not be used to deploy a production system but to | |
# understand how postgrest works. In particular there is no security | |
# implemented, see the docs for more. | |
# https://postgrest.org/en/v4.4/ |
This file contains hidden or 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
# Minimal example of getting a PostgREST API running from scratch for | |
# testing purposes. It uses docker to launch a postgres database and | |
# a postgrest api server. | |
# This should not be used to deploy a production system but to | |
# understand how postgrest works. In particular there is no security | |
# implemented, see the docs for more. | |
# https://postgrest.org/en/v4.4/ |
This file contains hidden or 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 table foo.stuff ( | |
value integer, | |
date timestamp | |
) | |
insert into foo.stuff values (42, '2017-09-10'); | |
insert into foo.stuff values (52, '2017-09-11'); | |
insert into foo.stuff values (62, '2017-09-12'); |
This file contains hidden or 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
$ export POSTGRAPHQL_ENV=development | |
$ export DEBUG=${DEBUG-postgraphql*,-postgraphql:graphql,-postgraphql:postgres:explain} | |
$ echo $DEBUG | |
postgraphql*,-postgraphql:graphql,-postgraphql:postgres:explain | |
$ postgraphql -c postgresql://postgraphql:postgraphql@localhost:5432/postgres --schema ct -n 0.0.0.0 --watch | |
PostGraphQL server listening on port 5000 🚀 | |
‣ Connected to Postgres instance postgres://localhost:5432/postgres | |
‣ Introspected Postgres schema(s) ct |
This file contains hidden or 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
postgres=# create table article_bug (id uuid, url text, data jsonb, text_search_vectors tsvector, created timestamp without time zone, dup boolean, simhash varchar, tree_pickle bytea, nltk jsonb); | |
CREATE TABLE | |
Time: 12.087 ms | |
postgres=# select master_create_distributed_table('article_bug', 'id', 'hash'); | |
master_create_distributed_table | |
--------------------------------- | |
(1 row) | |
Time: 10.927 ms |
This file contains hidden or 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
postgres=# explain select count(*) from article; | |
QUERY PLAN | |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |