CSN
2005-Nov-06  03:41 UTC
Fwd: Re: (PostgreSQL and Updateable views - renaming sequence won''t work)
--- Tom Lane <tgl-SaGXbTvoYpwrc1hdAPm73w@public.gmane.org> wrote:> To: CSN <cool_screen_name90001-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> > CC: "pgsql-general-RDL/qDirzP4Vy2MP9T7GeA@public.gmane.org" > <pgsql-general-RDL/qDirzP4Vy2MP9T7GeA@public.gmane.org> > Subject: Re: [GENERAL] sequence aliases? > Date: Sat, 05 Nov 2005 22:35:06 -0500 > From: Tom Lane <tgl-SaGXbTvoYpwrc1hdAPm73w@public.gmane.org> > > CSN <cool_screen_name90001-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> writes: > > I''m checking out Ruby on Rails and there''s a > tutorial > > about using Postgresql views and making them > > updateable > > >(http://wiki.rubyonrails.com/rails/pages/HowtoUsePostgresViewsAsTables).> > The tutorial suggests renaming the sequence for > the > > table to coincide with the view so that Rails can > > automatically access the sequence. I don''t like > this > > as it may break other things. > > Not to mention that it won''t actually work --- the > proposed approach > fails because PG will refuse to let you drop the > original sequence. > (It has failed in every release since 7.3, so I > don''t put a lot of stock > in that tutorial having been tested much.) > Furthermore, it''s quite > likely that future releases won''t let you fool with > the default > expression of a serial column at all. > > My advice to the Rails people would be to fix > whatever it is in their > code that is assuming a particular sequence name, or > indeed assuming > a sequence at all... > > regards, tom lane >__________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com