Recent Notes
Displaying notes 21 - 30
Created by voodoo on July 12, 2010 18:44:06
Use the \d command to show information about a table: postgres=# \d patchtype Table "public.patchtype" Column | Type | Modifiers -------------+-----------------------------+--------------- id | character varying(10) | not null code | character varying(32) | not null name | character varying(32) | suffix | character varying(32) | createddate | timestamp without time zone | default now() Indexes: "patchtype_pk" PRIMARY KEY, btree (id) "patchtype_code_key" UNIQUE, btree (code) postgres=#
Created by voodoo on July 12, 2010 18:41:26
Use the \dg command to list users: postgres=# \dg List of roles Role name | Attributes | Member of -----------+-------------+----------- boss | | {} postgres | Superuser | {} : Create role : Create DB postgres=#
Created by voodoo on July 12, 2010 18:37:14
Use the \d command to list tables, sequences, etc.: postgres=# \d List of relations Schema | Name | Type | Owner --------+--------------------+----------+------- public | carrierinfo | table | boss public | deviceinfo | table | boss public | eventdatalog | table | boss public | eventinfo | table | boss public | eventlog | table | boss public | settinginfo | table | boss (6 rows)
Created by voodoo on July 12, 2010 18:29:05
Last update: July 12, 2010 18:29:22
Use the \l command to list all databases: postgres=# \l List of databases Name | Owner | Encoding | Collation | Ctype | Access privileges -----------+----------+----------+-------------+-------------+----------------------- boss | boss | UTF8 | en_US.UTF-8 | en_US.UTF-8 | postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres : postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres : postgres=CTc/postgres (4 rows) postgres=#
Created by voodoo on July 12, 2010 18:26:19
Use the \i command to run a SQL script file: postgres=# \i /usr/share/pgsql/contrib/pgcrypto.sql
Created by voodoo on July 12, 2010 18:23:49
Create a database named boss with owner boss and template template0 : postgres=# create database boss owner=boss template=template0; CREATE DATABASE postgres=#
Created by voodoo on July 12, 2010 18:21:07
Create a user named boss with password 'bosspass' : postgres=# create user boss password 'bosspass'; CREATE ROLE postgres=#
Created by voodoo on July 09, 2010 21:24:22
To resolve the error: [focus@bamboo ~]$ psql -U postgres -W Password for user postgres: psql: FATAL: Ident authentication failed for user "postgres" Edit /var/lib/pgsql/data/pg_hba.conf , change ident to trust , then restart postgres: # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust host all all 105.52.84.50/32 trust # IPv6 local connections: host all all ::1/128 ident
Created by voodoo on July 09, 2010 21:02:35
The rpm command tells you where a package is installed: [root@bamboo ~]# rpm -ql postgresql-jdbc /etc/maven/fragments/postgresql-jdbc /usr/lib64/gcj/postgresql-jdbc /usr/lib64/gcj/postgresql-jdbc/postgresql-jdbc-8.4.701.jar.db /usr/lib64/gcj/postgresql-jdbc/postgresql-jdbc-8.4.701.jar.so /usr/share/doc/postgresql-jdbc-8.4.701 /usr/share/doc/postgresql-jdbc-8.4.701/LICENSE /usr/share/doc/postgresql-jdbc-8.4.701/README /usr/share/doc/postgresql-jdbc-8.4.701/pgjdbc.xml /usr/share/java/postgresql-jdbc-8.4.701.jar /usr/share/java/postgresql-jdbc.jar /usr/share/java/postgresql-jdbc2.jar /usr/share/java/postgresql-jdbc2ee.jar /usr/share/java/postgresql-jdbc3.jar /usr/share/maven2/poms/JPP-postgresql-jdbc.pom
Created by voodoo on July 09, 2010 19:41:10
Use the -n switch to copy files without overwriting existing ones in the target directory: cp -R -n sqlexplorer/* eclipse/