Differences

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

Link to this comparison view

Both sides previous revision Previous revision
sql:postgresql:backup [2008/07/14 16:04]
a removed
— (current)
Line 1: Line 1:
-====== PostgreSQL ====== 
  
- 
-===== PostgreSQL backup ===== 
- 
-**example** 
-   #!/bin/bash 
-   CAS=`date +"%d.%m.%y %T"` 
-   echo "Zacetek dumpanja: $CAS" 
-   echo "Zacetek dumpanja: $CAS" >> /var/log/postdump.err 
-   cd /var/backup/postgres 
-   rm -f *.sql.gz 
-   cd /var/lib/postgresql 
-    
-   for baza in `/bin/su -c "psql -l" postgres | tr -d ' ' | egrep -v "Name|-|Listofdatabases|rows|template0" | cut -f1 -d '|' | sed -e   '/^$/d'` 
-   do 
-      echo "Obdelujem bazo $baza" 
-      /bin/su -c "pg_dump $baza > $baza.sql" postgres 
-      gzip -f --best $baza.sql 
-     mv $baza.sql.gz /var/backup/postgres 
-   done 
-    
-   CAS=`date +"%d.%m.%y %T"` 
-   echo "Konec: $CAS" 
-   echo "Konec: $CAS" >> /var/log/postdump.err 
-   echo 
-   echo >> /var/log/postdump.err 
- 
-===== PostgreSQL Check Constraint Supports Regular Expressions ===== 
-   CREATE TABLE example_table ( 
-        first_name VARCHAR(100) 
-            CONSTRAINT check_first_name 
-           ( first_name ~* '^[a-z]+$') 
-   ); 
- 
-see: [[http://joseph.randomnetworks.com/archives/2004/05/24/postgresql-check-constraint-supports-regular-expressions/|this]] 
sql/postgresql/backup.1216044245.txt.gz ยท Last modified: 2009/05/25 00:34 (external edit)
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready