Search
 
SCRIPT & CODE EXAMPLE
 

SQL

psql fatal database does not exist

# So you do not have to create a database with your role name

psql -U Username DatabaseName 
Comment

fatal database postgres does not exist

psql -d template1
Comment

psql: error: FATAL: database "odoo" does not exist

# if your database is different as your login name you must add the database name
psql -U Username DatabaseName 
Comment

psql database does not exist

It appears that your package manager failed to create the database named $user for you. The reason that

psql -d template1
works for you is that template1 is a database created by postgres itself, and is present on all installations. You are apparently able to log in to template1, so you must have some rights assigned to you by the database. Try this at a shell prompt:

createdb
and then see if you can log in again with

psql -h localhost
Comment

fatal database postgres does not exist

If the field is already a string, this will work

 SELECT RIGHT('000'+ISNULL(field,''),3)
If you want nulls to show as '000'

It might be an integer -- then you would want

 SELECT RIGHT('000'+CAST(field AS VARCHAR(3)),3)
Comment

PREVIOUS NEXT
Code Example
Sql :: how to convert null to float in mysql 
Sql :: inserted row count tsql 
Sql :: how to increase the width of the screen in oracle 
Sql :: Oracle cx_Oracle example 
Sql :: postgres advance auto increment 
Sql :: create a database mysql 
Sql :: sql interview questions for testers 
Sql :: php select data from mysql database without column name 
Sql :: timestamp(0) postgresql 
Sql :: ms sql check if column is nullable 
Sql :: google sheets filter rows above current cell 
Sql :: sql developer connect to sql server 
Sql :: advantages of stored procedures sql 
Sql :: apex for oracle 11g 
Sql :: select columns from 2 tables with foreign key 
Sql :: sql strip non alphanumeric characters 
Sql :: what is 1=2 in sql 
Sql :: can i use alias in where clause 
Sql :: arithmetic expression in sql 
Sql :: adding column 
Sql :: update view sql 
Sql :: mysql split explode 
Sql :: sql server in python 
Sql :: mysql drop tables 
Sql :: create-toys-table-with-toy_name-column 
Sql :: grant privileges mysql to database 1064 
Sql :: Serilog Table Configurations for MSSQLSERVER SINK 
Sql :: delete double on SQL with multiple primary keys 
Sql :: clauses in mysql 
Sql :: value of sold product using having and group by in sql 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =