On Feb 17, 2009, at 7:47 PM, Stu wrote:
> > On Feb 18, 11:35 am, Robert Creager <[email protected]> wrote: > >> You're running an older version (< 8.2) of PostgreSQL. DataMapper >> doesn't support those correctly (I just ran across that exact problem >> this weekend - I'm running 8.1.1). There is a ticket open for this >> issue, but I don't have it handy. I'm able to use multiple db >> servers >> so I got around the problem easily enough ;-) >> >> The newer versions of PostgreSQL support a custom extension that >> returns the serial id generated on the insert. > > Thanks for the hint. I checked with MacPorts which PostgreSQL > version I have: > > ... > postgresql83 @8.3.5 databases/postgresql83 > postgresql83 @8.3.5 databases/postgresql83 > > And my PATH starts with /opt/local/lib/postgresql83/bin. > > Doing a "locate postgresql82" doesn't seem to find any other > installations either. Could there be earlier versions of libraries > that DM is using? Blah (sound of a blank mind)... Try <where pg_config>: where pg_config pg_config is /Library/PostgreSQL8/bin/pg_config Or <locate pg_config>... Do you get something like this from pgsql: Robert=# create table test( id serial, test varchar ); NOTICE: CREATE TABLE will create implicit sequence "test_id_seq" for serial column "test.id" CREATE TABLE Robert=# insert into test( test ) values( 'test' ) returning id; id ---- 1 (1 row) INSERT 0 1 Robert=# insert into test( test ) values( 'test' ) returning id; id ---- 2 (1 row) INSERT 0 1 Robert=# select * from version(); version ------------------------------------------------------------------------------------------------------------------------------ PostgreSQL 8.3.5 on i386-apple-darwin9.5.0, compiled by GCC i686- apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5488) (1 row) Or more like this: robert=# create table test( id serial, test varchar ); CREATE TABLE robert=# insert into test( test ) values( 'test' ) returning id; ERROR: syntax error at or near "returning" at character 43 LINE 1: insert into test( test ) values( 'test' ) returning id; ^ robert=# select * from version(); version ----------------------------------------------------------------------------------------------------------- PostgreSQL 8.1.1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.1 20060724 (prerelease) (4.1.1-3mdk) > > > Thanks, > > Stu > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---
