Skip to content

Commit

Permalink
Drop "postgres" arg (thanks PGDATABASE)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgroomes committed Jul 30, 2024
1 parent 42d8c5f commit 722fe19
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

---

## Standalone sub-projects
## Standalone subprojects

This repository illustrates different concepts, patterns and examples via standalone sub-projects. Each sub-project is
completely independent of the others and do not depend on the root project. This _standalone sub-project constraint_
forces the sub-projects to be complete and maximizes the reader's chances of successfully running, understanding, and
This repository illustrates different concepts, patterns and examples via standalone subprojects. Each subproject is
completely independent of the others and do not depend on the root project. This _standalone subproject constraint_
forces the subprojects to be complete and maximizes the reader's chances of successfully running, understanding, and
re-using the code.

The sub-projects include:
The subprojects include:

### `arrays/`

Expand Down Expand Up @@ -48,9 +48,9 @@ Generate test data to aid in performance exploration and analysis.
See the README in [test-data/](test-data/).


## WishList
## Wish List

General clean-ups, TODOs and things I wish to implement for this project:

* DONE Explore Postgres without Docker. I'd like to learn the basics of `pg_ctl` so I don't need to depend on Docker to run
* [x] DONE Explore Postgres without Docker. I'd like to learn the basics of `pg_ctl` so I don't need to depend on Docker to run
Postgres (although Docker is super convenient!)
4 changes: 2 additions & 2 deletions arrays/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Follow these instructions to explore arrays in Postgres.
name will differ so take care to adjust the `psql` commands accordingly.
2. Apply the schema:
* ```shell
psql postgres -f observations-schema.ddl
psql -f observations-schema.ddl
```
3. Insert test data:
* ```shell
psql postgres -f observations-data.sql
psql -f observations-data.sql
```
4. Try out the queries in `observations-explore.sql` and learn about SQL arrays!
* For example, execute the `observations-ad-hoc-query.sh` with the following command.
Expand Down
2 changes: 1 addition & 1 deletion arrays/observations-ad-hoc-query.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Execute an ad hoc query from a shell script against the Postgres database.
# Specifically, we want to see if we can use a heredoc to define the query.

psql postgres << EOF
psql << EOF
select format('"%s"', description), array_length(notes, 1) from observations
EOF
2 changes: 1 addition & 1 deletion arrays/observations-export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
# References used:
# * https://www.postgresql.org/docs/13/functions-string.html

psql postgres \
psql \
-c "\copy (select description, concat_ws(';', variadic notes) from observations) to stdout;"
4 changes: 2 additions & 2 deletions lag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Follow these instructions to explore the windowing feature in Postgres.
name will differ so take care to adjust the `psql` commands accordingly.
2. Apply the schema:
* ```shell
psql postgres -f snapshots-schema.ddl
psql -f snapshots-schema.ddl
```
3. Insert test data:
* ```shell
psql postgres -f snapshots-data.sql
psql -f snapshots-data.sql
```
4. Try out the queries `snapshots-explore.sql` and learn about `lag`!

Expand Down

0 comments on commit 722fe19

Please sign in to comment.