Re : Re : Re : [GENERAL] Resetting SEQUENCEs

2007-10-19 Thread Laurent ROCHE
age d'origine De : Alvaro Herrera <[EMAIL PROTECTED]> À : Laurent ROCHE <[EMAIL PROTECTED]> Cc : Martijn van Oosterhout <[EMAIL PROTECTED]>; pgsql-general@postgresql.org Envoyé le : Jeudi, 18 Octobre 2007, 23h54mn 16s Objet : Re: Re : Re : [GENERAL] Resetting SEQUENCEs L

Re: Re : Re : [GENERAL] Resetting SEQUENCEs

2007-10-18 Thread Alvaro Herrera
Laurent ROCHE wrote: > Hi, > > So nobody can help me to write the SELECT that will return the SEQUENCE > names, and their linked columns and their linked tables ? > Are the system tables documented somewhere ? Of course -- in the "internals" section. You need pg_class where relkind = 's', pg_de

Re : Re : [GENERAL] Resetting SEQUENCEs

2007-10-18 Thread Laurent ROCHE
ROTECTED]> À : Martijn van Oosterhout <[EMAIL PROTECTED]> Envoyé le : Jeudi, 18 Octobre 2007, 20h15mn 46s Objet : Re : [GENERAL] Resetting SEQUENCEs Yes, but when I change a database schema and I reload the data, and I need to resynch the SEQUENCE so that the INSERT command will work !

Re: [GENERAL] Resetting SEQUENCEs

2007-10-18 Thread Martijn van Oosterhout
On Thu, Oct 18, 2007 at 10:06:00AM -0700, Laurent ROCHE wrote: > Hi, > > I am quite surprised I could not find a way to automatically reset the value > of a sequence for all my tables. I never bother resetting sequences. It's not like the numbers mean anything... Have a nice day, -- Martijn va

Re : [GENERAL] Resetting SEQUENCEs

2007-10-18 Thread Laurent ROCHE
MAIL PROTECTED]> À : Laurent ROCHE <[EMAIL PROTECTED]> Cc : pgsql-general@postgresql.org Envoyé le : Jeudi, 18 Octobre 2007, 19h33mn 50s Objet : Re: [GENERAL] Resetting SEQUENCEs 2007/10/18, Laurent ROCHE <[EMAIL PROTECTED]>: > > Hi, > > I am quite surprised I could not

Re: [GENERAL] Resetting SEQUENCEs

2007-10-18 Thread Alan Hodgson
On Thursday 18 October 2007, Laurent ROCHE <[EMAIL PROTECTED]> wrote: > Hi, > > I am quite surprised I could not find a way to automatically reset the > value of a sequence for all my tables. > > Of course, I can write: > SELECT setval('serial', max(id)) FROM distributorsBut if I reload data > into

Re: [GENERAL] Resetting SEQUENCEs

2007-10-18 Thread Filip Rembiałkowski
2007/10/18, Laurent ROCHE <[EMAIL PROTECTED]>: > > Hi, > > I am quite surprised I could not find a way to automatically reset the value > of a sequence for all my tables. > > Of course, I can write: > SELECT setval('serial', max(id)) FROM distributors > But if I reload data into all my tables, it's

[GENERAL] Resetting SEQUENCEs

2007-10-18 Thread Laurent ROCHE
Hi, I am quite surprised I could not find a way to automatically reset the value of a sequence for all my tables. Of course, I can write: SELECT setval('serial', max(id)) FROM distributorsBut if I reload data into all my tables, it's a real pain to have to write something like this for every s