See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
The connection failed because by default psql connects over UNIX sockets using peer authentication, that requires the current UNIX user to have the same user name as psql. So you will have to create the UNIX user postgres and then login as postgres or use sudo -u postgres psql database-name for accessing the database (and psql should not ask for a password).
If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres (as pointed out by @meyerson answer) will solve your immediate problem.
But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf* line:
from
ΠΠ±ΡΠΈΠ΅ ΡΠΏΡΠΎΡΠ΅Π½Π½ΡΠ΅ ΠΏΠΎΠ½ΡΡΠΈΡ. ΠΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ ΡΡΡΠ΅ΡΡΠ²ΡΡΡ ΡΠΏΠΎΡΠΎΠ±Ρ Π·Π°Π΄Π°ΡΡ Π΄ΡΡΠ³ΠΎΠ΅ ΠΏΠΎΠ²Π΅Π΄Π΅Π½ΠΈΠ΅ Π½Π΅ΠΆΠ΅Π»ΠΈ Π΄Π°Π½Π½ΠΎΠ΅ ΡΠΏΠΎΡΠ΅Π½Π½ΠΎΠ΅.
| if (!String.prototype.repeat) { | |
| // polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat | |
| String.prototype.repeat = function(count) { | |
| 'use strict'; | |
| if (this == null) { | |
| throw new TypeError('can\'t convert ' + this + ' to object'); | |
| } | |
| var str = '' + this; | |
| count = +count; | |
| if (count != count) { |
| @startuml | |
| ' uncomment the line below if you're using computer with a retina display | |
| ' skinparam dpi 300 | |
| !define Table(name,desc) class name as "desc" << (T,#FFAAAA) >> | |
| ' we use bold for primary key | |
| ' green color for unique | |
| ' and underscore for not_null | |
| !define primary_key(x) <b>x</b> | |
| !define unique(x) <color:green>x</color> | |
| !define not_null(x) <u>x</u> |
| // usage: {{ file.size | prettyBytes }} | |
| Vue.filter('prettyBytes', function (num) { | |
| // jacked from: https://github.com/sindresorhus/pretty-bytes | |
| if (typeof num !== 'number' || isNaN(num)) { | |
| throw new TypeError('Expected a number'); | |
| } | |
| var exponent; | |
| var unit; | |
| var neg = num < 0; |
| public <T> T streamQuery(String sql, Function<Stream<SqlRowSet>, ? extends T> streamer, Object... args) { | |
| return jdbcTemplate.query(sql, resultSet -> { | |
| final SqlRowSet rowSet = new ResultSetWrappingSqlRowSet(resultSet); | |
| final boolean parallel = false; | |
| // The ResultSet API has a slight impedance mismatch with Iterators, so this conditional | |
| // simply returns an empty iterator if there are no results | |
| if (!rowSet.next()) { | |
| return streamer.apply(StreamSupport.stream(Spliterators.emptySpliterator(), parallel)); | |
| } |
| require 'net/http' | |
| require 'json' | |
| require 'uri' | |
| @token = '' | |
| def list_files | |
| ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago | |
| params = { | |
| token: @token, |
| SELECT | |
| arrays.firstnames[s.a % ARRAY_LENGTH(arrays.firstnames,1) + 1] AS firstname, | |
| substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ' from s.a%26+1 for 1) AS middlename, | |
| arrays.lastnames[s.a % ARRAY_LENGTH(arrays.lastnames,1) + 1] AS lastname | |
| FROM generate_series(1,300) AS s(a) -- number of names to generate | |
| CROSS JOIN( | |
| SELECT ARRAY[ | |
| 'Adam','Bill','Bob','Calvin','Donald','Dwight','Frank','Fred','George','Howard', | |
| 'James','John','Jacob','Jack','Martin','Matthew','Max','Michael', | |
| 'Paul','Peter','Phil','Roland','Ronald','Samuel','Steve','Theo','Warren','William', |
People
:bowtie: |
π :smile: |
π :laughing: |
|---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |