Last active
November 30, 2021 20:59
-
-
Save JoshCheek/857f6c4fb5d50f20164ceccac8034873 to your computer and use it in GitHub Desktop.
~/.psqlrc example
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
| -- vi: ft=pgsql | |
| -- Nice prompt: | |
| -- Modified from here: https://stackoverflow.com/a/19155772 | |
| -- Docs are here: https://www.postgresql.org/docs/9.3/app-psql.html#APP-PSQL-PROMPTING | |
| \set PROMPT1 '%[%033[33m%]%n%[%033[0m%]@%[%033[1;33m%]%/%[%033[0m%]%R ' | |
| \set PROMPT2 :PROMPT1 | |
| -- Nuvocargo specific changes | |
| do $$ begin if exists (select 1 from pg_catalog.pg_namespace where nspname = 'airtable') then | |
| set search_path = pg_temp, "$user", public, airtable; | |
| create temp view sync_info as | |
| select | |
| now(), | |
| completed_at, | |
| now()-completed_at, | |
| duration_last | |
| from airtable._sync_meta; | |
| end if; end $$ language 'plpgsql'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment