User Tools

Site Tools


postgres:postgresql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
postgres:postgresql [2010/05/31 14:03] devapostgres:postgresql [2011/01/25 07:44] (current) deva
Line 2: Line 2:
 =====Open sql cli interface====== =====Open sql cli interface======
 <code> <code>
-psql -U [username] -W [password]+psql -U [username] -W [database]
 </code> </code>
  
Line 25: Line 25:
 <code> <code>
 ALTER TABLE data ALTER COLUMN filename TYPE character varying(255) USING substring(filename from 20); ALTER TABLE data ALTER COLUMN filename TYPE character varying(255) USING substring(filename from 20);
 +</code>
 +
 +=====Find missing foreign key values=====
 +<code>
 +SELECT foo.xcpr FROM (SELECT a.personid AS xcpr, b.personid AS ycpr FROM examinations AS a LEFT OUTER JOIN person AS b ON a.personid = b.personid) AS foo WHERE foo.ycpr IS NULL;
 +</code>
 +
 +=====Disable pager (less/more) in psql=====
 +<code>
 +\pset pager
 </code> </code>
postgres/postgresql.1275307434.txt.gz · Last modified: 2010/05/31 14:03 by deva