Displaying 20 results from an estimated 22 matches for "postgresqladapter".
Did you mean:
postgresql_adapter
2010 Jun 30
0
I have problem ....PostgreSQLAdapter::PGconn
I have a problem when i am creating a rails project using postgresql...
uninitialized constant
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::PGconn
I have already installed gem postgres-pr. but not start..
I using rails version 2.3.5
Ruby 1.8.7
PostgresSQL 1.10.2.
Please help me thanks.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk&qu...
2013 Jun 14
0
Support for deferrable constraints in PostgreSQLAdapter#disable_referential_integrity
I recently submitted a pull-request
(https://github.com/rails/rails/pull/10939) to address a bug in
PostgreSQLAdapter#disable_referential_integrity related to how the
existing code behaves in a transaction when the PostgreSQL user account
lacks superuser privileges on the PostgreSQL instance.
While this permits the code to function without crashing, it doesn''t
actually make #disable_referential_integrity...
2006 Jan 13
1
How to disconnect to a database????
...bj1["colaa"] = 100
obj1["colab"] = "100"
obj1.save # should have raised exception or error
here
end
end
####################################################################################
the output of index
@connected1:
#<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter:0x2aaaac138930
@runtime=0.0189187526702881,
@connection=#<PGconn:0x2aaaac138980>,
@logger=#<Logger:0x2aaaac2e7fd8
@default_formatter=#<Logger::Formatter:0x2aaaac2e7dd0
@datetime_format=nil>, @progname=nil,
@logdev=#<Logger::LogDevice:0x2aaaac2e7ce0
@shift_size=1048576, @shift_age=...
2008 Jan 16
0
[CruiseControl] RubyOnRails build 8649 failed
...ng/setup_and_teardown.rb:90:in `run''
Name: test_add_column_not_null_with_default(MigrationTest)
Type: Failure
Message: Exception raised:
Class: <NameError>
Message: <"undefined local variable or method `quoted_column_name'' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter:0xb74d5154>">
---Backtrace---
./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:597:in `add_column''
./test/migration_test.rb:209:in `test_add_column_not_null_with_default''
./test/migration_test.rb:209:in `test_add_column_not_null_with_default'...
2006 Aug 08
2
Problem with plurals, migrations?
...able_name "hardware"
has_many :schedules
end
When I run the migration the table creation occurs, but then I get this
error:
-- create({:vendor=>"Foo", :model=>"Bar"})
rake aborted!
undefined method `create'' for
#<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter:0x39293cc>
My guess is that it was expecting a "hardwares" table instead of
"hardware", and is getting confused. But, I didn''t see a method in the
docs to set the table name ala ActiveRecord.
Or am I missing something obvious here? I checked the docs and Google,...
2005 Apr 23
2
[Tip] Introspection to determine if a column may be null
...adaptor itself) are very
much welcomed. As our implementations for any other adaptors.
# From my own lib/rails_extensions.rb file, included in
config/environment.rb
class ActiveRecord::ConnectionAdapters::Column
def required?
@required
end
end
class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
alias_method :_real_columns, :columns
def columns( table_name, name=nil )
cols = _real_columns( table_name, name )
cols.each{ |col|
sql = "select is_nullable from information_schema.columns where
table_name=''#{table_name}'' and column_name=''#{c...
2009 Oct 14
2
How to configure every (postgresql) db connection?
...wing into an initializer:
ActiveRecord::Base.connection.execute("SET statement_timeout = 1000")
but this does not have the desired effect - it is not set for all
connections. I assume this has to do with the connection pool rails
uses - the code above just sets it for a single one.
The PostgreSQLAdapter issues some SET statements itself for each new
connection - is there a good way to add your own configuration
statements, either specific to the PostgreSQLAdapter or in a general
way?
Til
2005 Dec 22
2
nonstandard postgresql sequence names
I''m working with a legacy postgresql database where the names of tables,
columns, etc., do not usually follow Rails conventions.
I''ve been able to work around it for the most part, but I ran into this:
I have the following test:
require File.dirname(__FILE__) + ''/../test_helper''
class SponsorTest < Test::Unit::TestCase
self.use_transactional_fixtures =
2006 Oct 15
3
Migrations - add_column :default=>true, :null=>false
This seems pretty brain dead:
add_column :types, :notify_on_create, :boolean, {:default=>true,
:null=>false}
$ rake migrate
Error: ERROR: column "notify_on_create" contains null values
: ALTER TABLE types ALTER notify_on_create SET NOT NULL
Why doesn''t Rails set the new column to true, as it''s supposed to
default to? I tried :default=>1 as well (same
2012 Jul 18
5
Any comment on adding #cast and #cast! to ActiveRecord::Relation?
Not getting any love (tender or otherwise) on my pull
request<https://github.com/rails/rails/pull/7035>so I thought you
folks might like to chip in. What do you think?
#cast and #cast! allow you to declare a mapping from generated column names
to simplified
database column types (i.e. those used in migrations). This way scopes with
columns generated in their select lists can also include
2006 Feb 19
2
possible rails -> postgresql bug
Hi I have a problem accessing an array field in a Postgresql database.
Here is the table definition.
View "neil.flashing_codes"
Column | Type | Modifiers
-------------+-----------------------+-----------
code | character varying(10) |
description | text |
folds | integer[] |
View definition:
SELECT
2006 Jan 18
1
Helps!!!!! Rails database connection guru needed!!!!!!!
...y can help
us to answer those questions!!!!!
Question A- How rails disconnect the connection?
As we can see in the source code :
Call stack for postgresql
1- any controller
2- connectionspecification.establish_connection
3- ActiveRecord::base.postgresql_connection(config)
4- ConnectionAdapters::PostgreSQLAdapter.new(
PGconn.connect(), logger )
5- connection_specification.establish_connection
@@defined_connections[self] = spec
The connection is made while Rails calls
PGconn.connect(), then the connectionstored in
@connection of the adapter class. while a request is
send to the adapter,the adapter will sen...
2006 Jan 05
7
HOWTO: Combine fields from 2 two tables in 1 object
Hi all,
For a dropdownlist (showing "Company - FirstName Lastname'') I want to fill an
object @project_contacts with "Name" from table Companies and "Firstname" and
"Lastname" from table contacts. Any idea?
Regards,
Gerard.
--
"Who cares if it doesn''t do anything? It was made with our new
Triple-Iso-Bifurcated-Krypton-Gate-MOS
2006 May 19
0
Migrations: The same class name form migration and model cause problems
I need to bootstrap my database when creating schema. My model class and
migration class are the same.
When I trying: ClassName.create :foo => ''bar'' in migration I got:
undefined method `create'' for
#<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter:0xb75a357c>
How to avoid this? I think the same class names causes problem, but I
can''t change class names.
2006 Apr 25
0
Migrate default now()
...sql << " DEFAULT #{quote(options[:default],
options[:column])}" unless options[:default].nil?
end
end
sql << " NOT NULL" if options[:null] == false
end
end
end
end
module ActiveRecord
module ConnectionAdapters
class PostgreSQLAdapter < AbstractAdapter
def now(value, column)
"current_timestamp"
end
end
end
end
test code:
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
# ...
t.column :created_at, :timestamp, :null => false, :default...
2006 Mar 02
1
PostgreSQL function in an insert statement
Hi there,
I wont insert a picture in a PostgrSQL-DB via the function lo_import.
Therfore I modify the value of an ''oid'' column.
@measurepoint = Measurepoint.new(params[:measurepoint])
@measurepoint.measurepoint_background = "lo_import(''#{@params[''measurepoint''][''measurepoint_background'']'')"
@measurepoint.save
The
2008 Feb 22
0
[PATCH] fix postgresql_adapter index dumping with multiple schemas
Hi,
I''ve recently updated an old patch to PostgreSQLAdapter#indexes, which
fixes a bug with schema dumping with multiple database schemas
present. The new patch corrects an edge case bug in the original
patch, includes test cases, and has been tested against PostgreSQL
7.4, 8.1 and 8.3.
The ticket is at http://dev.rubyonrails.org/ticket/8659 ; I''d...
2007 Jun 19
2
sequence name prefix
In Postgres, I use different database schemas for each application, by
declaring, e.g.:
class ApplicationController < ActionController::Base
ActiveRecord::Base.table_name_prefix = "keywords."
end
I assumed that the sequence names were also prefixed with the database
schema names, e.g.
keywords.things_id_seq
But Rails 1.2.3 assumes the sequence is *NOT* in the same schema as the
2009 Sep 28
5
Multi-databases support
Hi,
While I was hacking ovirt-server, I have found that it's currently
restricted to Postgres DB. Even if I like postgres for serious work on a
server, I really prefer to hack/dev locally on a Sqlite or MySQL DB.
I have googled on rails in order to find a good answer for the "foreign
key problem" which forces OVirt to stay on pg. I have found a plugin on
this particular
2008 Nov 03
17
SQL queries in Rails
Hi...
I want to know the equivalent instructions to insert, update, search
and delete a registry. I know Rails can do it easily Thanks to
ActiveRecord, but here''s the catch: I''m using PostgreSQL. As I''m using
SQL to do the migration (Including the foreign keys), I need to know
if I can use SQL queries to do those actions. Is there an example out
there?
I uncommented