RPM of new version of are available in remi repository for Fedora 10 to 14.
The official site also provides RPM for Fedora 12.
To work, you need RPM Oracle Instant Client.
Pour l'installer, comme toujours :
yum --enablerepo=remi install toraThis tool can be used to manage your Oracle, PostgreSQL and MySQL databases. Despite this software is GPLv2, it can't be included in the official repository because of its link with... tora-2.1.3
RPM of new version of are available in remi repository for Fedora ≥ 9.
The official site also provides RPM for Fedora 12.
To work, you need RPM Oracle Instant Client.
Pour l'installer, comme toujours :
yum --enablerepo=remi install toraThis tool can be used to manage your Oracle, PostgreSQL and MySQL databases. Despite this software is GPLv2, it can't be included in the official repository because of its link with... tora-2.1.2
So, I tend to do a lot of lower-level stuff on OS-X such as compiling my own for development and testing purposes. One of the things that tends to interrupt the process of actually trying to run postgres is that it cannot change to the postgres user and it cannot run it as root.
In order to accomplish this you could make a user with your System Preferences which I have done in the past, the problem is then every time you log into your computer you’ll see this postgres user for no reason. Ugh, I hate that. So to work around this you just have to run the following commands in your OS-X terminal to add a group and user for postgres, with the user “home” being the default compilation target directory for PostgreSQL (/usr/local/pgsql)
This is confirmed to work on every version of Leopard and Snow Leopard.
Чтобы в PostgreSQL предоставить readonly доступ ко всем созданным к текущему моменту таблицам определенной БД (но за исключением системных таблиц), можно воспользоваться командой:
psql -U postgres -qAt -c "select 'grant select on ' || tablename || ' to username;' from pg_tables where schemaname = 'public'" db_name | psql -U postgres db_name
Где вместо «grant select on» можно указать список доступов, к примеру "grant select, update, insert, delete on ".
Имя супер-пользователя: postgres, название БД, к таблицам которой предоставляется доступ: db_name, название пользователя, которому предоставляется ограниченный доступ: username.
Делаю очередной проект на Ruby on Rails. Как обычно, в миграциях понадобились foreign keys на уровне БД. Окинул взглядом все плагины, которые смог найти в google и на github.com. Ни один из них не умеет делать FK, используя и .
Поэтому сел и написал свой плагин: .
Установка:
Rails::Initializer.run do |config|
...
config.gem "active_record_foreign_keys", :source => "http://gemcutter.org"
...
end
$ rake gems:install
Использование:
def self.up
# create reference table
create_table :users do |t|
end
# create referencing table
create_table :a_examples do |t|
t.references :user, :foreign_key => true
end
# or
create_table :b_examples do |t|
t.references :user, :foreign_key => { n_update => :cascade, n_delete => :restrict }
end
# or
create_table :c_examples do |t|
end
add_foreign_key :c_examples, :user_id, :users, :id, n_update => :no_action, n_delete => :set_null
# or change existing table
change_table :d_examples do |t|
t.references :user, :foreign_key => true
end
end
def self.down
# remove constraint
remove_foreign_key :examples, :user_id, :users, :id
end
Плагин тестировался только под PostgreSQL, но по идее должен работать и под MySQL, и под Sqlite.
В этой заметке описано, как установить memcached на ту же машину, где уже запущен pgbouncer (из репозитория pgdg). Сложность в том, что pgbouncer использует более новую версию libevent, чем memcached, в результате чего memcached при установке выдает «transaction failed».
Один из наиболее красивых выходов из ситуации — пересборка SRPM с новой библиотекой libevent, а заодно и новой версией memcached.
В случае, если репозиторий pgdg еще не установлен, его можно инсталировать следующей командой (версию можно выбрать на странице )
Я активно начал пробовать завести rails-приложения на ruby 1.9.1. В целом, все неплохо работает, но мелкие косяки бывают. Например, в .
Для работы с пришлось доработать гем postgres. Теперь гем компилируется как под ruby 1.8, так и под ruby 1.9. Кроме того, всем строковым данным, которые возвращает БД, навешивается кодировка из Encoding.external_encoding. Поставить доработанный гем можно командой:
Но я хотел о другом написать. Об ошибке несовместимости кодировок ASCII-8BIT и UTF-8: ActionView::TemplateError (incompatible character encodings: ASCII-8BIT and UTF-8). Такая ошибка появляется при запуске Rails на ruby 1.9.1. В edge-версии rails ошибка все еще не исправлена. Для исправления нужно закинуть в config/initializers/.