Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility issues with PostgreSql? #23

Open
prefork opened this issue Sep 16, 2010 · 7 comments
Open

Compatibility issues with PostgreSql? #23

prefork opened this issue Sep 16, 2010 · 7 comments
Labels

Comments

@prefork
Copy link

prefork commented Sep 16, 2010

I can't seem to get wind to play nice with postgres. On the /post/new page the hidden "id" field remains unfilled (null) and so when I click submit, it tries to create a record without a primary key (and fails and throws a 500 error). Any advice on this?

**I'm on PostgreSQL 8.3.

@19WAS85
Copy link
Owner

19WAS85 commented Sep 21, 2010

Realy exists a issue when connects in Postgres. The problem is on set_schema of post model, Sequel schema don't translate columns types to Postgres.

I will work to solve this, but if you discover a solution, please, pull request.

@richardsondx
Copy link

+1

@19WAS85
Copy link
Owner

19WAS85 commented Aug 7, 2012

I think that is the mapping of models (set_schema). Some sequel references uses "String :title" instead of "varchar :title", as is in Wind.

@19WAS85
Copy link
Owner

19WAS85 commented Aug 7, 2012

And about primary key on Postgress, I found this:

primary_key The primary key for the class. Sequel can determine this automatically for many databases, but not all, so you may need to set it manually. If not determined automatically, the default is :id.

http://sequel.rubyforge.org/rdoc/classes/Sequel/Model/ClassMethods.html

@richardsondx
Copy link

https://gist.github.com/3282515

I tried:

set_schema do
    integer :id
    String :title
    String :text
    datetime :date
    String :link

    set_primary_key :id
end

but it didn't work.

@19WAS85
Copy link
Owner

19WAS85 commented Aug 7, 2012

With:

set_schema do
    primary_key :id

Sequel generates a integer column with primary key constraint?

@richardsondx
Copy link

My schema was like that before it didnt work. Did you see the gist?
set_schema do
primary_key :id
String :title
String :text
datetime :date
String :link
end

When I do ;heroku log':

2012-08-07T06:46:04+00:00 app[web.1]: Sequel::DatabaseError - PG::Error: ERROR: invalid input syntax for integer: ""

I'm getting this at each shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants