Step 1GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA name_schema TO name_user;
Step 2GRANT USAGE ON SCHEMA name_schema TO name_user;
Step 1GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA name_schema TO name_user;
Step 2GRANT USAGE ON SCHEMA name_schema TO name_user;
psql -U postgres -c ‘DROP DATABASE DbName’
UPDATE names SET fullname=RTRIM(REVERSE(SUBSTRING(REVERSE(fullname),LOCATE(" ",REVERSE(fullname)))))
sudo -u postgres psql
\password postgres
Then to quit:
\q
change jdk version use openjdk-8
using
#update-alternatives –config java
need to alter the CONSTRAINT then run the import command
ALTER TABLE collection2item DROP CONSTRAINT collection2item_item_id_fkey;
ALTER TABLE community2community DROP CONSTRAINT community2community_child_comm_id_fkey;
ALTER TABLE community2collection DROP CONSTRAINT community2collection_collection_id_fkey;
change in pg_hba.conf
local all all peer
to
local all all
trust
Backup: $ pg_dump -U {user-name} {source_db} -f {dumpfilename.sql} Restore: $ psql -U {user-name} -d {desintation_db}-f {dumpfilename.sql}
su – postgres
psql -U postgres -d DBname
mydb=# update TableName SET FieldName=replace(FieldName,’text-to-replcae’,’the-new-text’);
mydb=# \q