local all postgres peer
local all postgres md5
local all all md5
Cac chu de hay ve Postgres:
http://momjian.us/main/blogs/pgblog_categories.html
- One of the nicest feature of Postgresql is index on expression:http://www.postgresql.org/docs/9.0/interactive/indexes-expressional.html
http://www.ienablemuch.com/2010/12/postgresql-speeding-up-slow-coalesce.html - CTE, also supports recursion http://www.ienablemuch.com/2010/04/simple-hierarchical-query-display.html
- generate_series http://www.ienablemuch.com/2010/12/date-functions.html
- Windowing functions: http://www.ienablemuch.com/2011/01/postgresql-lag-windowing-function.html
- Superb date functions http://www.ienablemuch.com/2010/12/finding-previous-day-of-week.html
- Richer data types http://www.ienablemuch.com/2010/05/varchar-ip-address-sorting.html
- Functional dependency on primary keys when grouping on it (on next version, 9.1)http://www.ienablemuch.com/2010/08/postgresql-recognizing-functional.html
- User-defined operator: Adding sum of current_timestamp and days column in Postgres
-
And don't forget the DDL, it's also transaction safe:
BEGIN; ALTER TABLE foo DROP COLUMN bar; ALTER TABLE foo ADD COLUMN baz INET; COMMIT;
Great for maintenance work, you will always have a consistent database, even when you lose the database connection or the server goes down.
Unicode:
update pg_database set datallowconn = TRUE where datname = 'template0'; \c template0 update pg_database set datistemplate = FALSE where datname = 'template1'; drop database template1; create database template1 with template = template0 encoding = 'UTF8' LC_CTYPE = 'en_US.utf8' LC_COLLATE = 'en_US.utf8'; update pg_database set datistemplate = TRUE where datname = 'template1'; \c template1 update pg_database set datallowconn = FALSE where datname = 'template0';
No comments:
Post a Comment
New comment