Re: [HACKERS] Moving sequences to another schema

2005-06-30 Thread Michael Glaesemann
On Jun 30, 2005, at 8:13 PM, Bernd Helmle wrote: I currently recognized that a SERIAL column doesn't only create an implicit sequence, it creates an implicit composite type with the same name, too. I think this is the same for CREATE SEQUENCE? Sequences are just special types of tables. Al

Re: [HACKERS] Moving sequences to another schema

2005-06-30 Thread Bernd Helmle
--On Dienstag, Juni 28, 2005 01:43:27 +0200 Bernd Helmle <[EMAIL PROTECTED]> wrote: When altering a sequence created by a SERIAL column type (i do this by examining pg_depend to avoid moving any other sequences that are 'foreign'), i need to recreate the default expression for the SERIAL column

Re: [HACKERS] Moving sequences to another schema

2005-06-28 Thread Tom Lane
Bernd Helmle <[EMAIL PROTECTED]> writes: > Whats the least that should go to -patches for > feature release on 1 July (only to know, if i can hold timeline or not).?? Something reasonably complete, working, credible. We'll cut you slack on documentation changes and regression tests, and if it ha

Re: [HACKERS] Moving sequences to another schema

2005-06-28 Thread Bernd Helmle
--On Dienstag, Juni 28, 2005 02:01:33 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: Not adsrc --- that's not trustworthy. Yes, that's documented in the docs, too. In practice I think you could just assume you know what the default expression ought to be, and store a new one without looking at

Re: [HACKERS] Moving sequences to another schema

2005-06-28 Thread Bernd Helmle
--On Dienstag, Juni 28, 2005 09:38:56 +0800 Christopher Kings-Lynne <[EMAIL PROTECTED]> wrote: Does ALTER TABLE/RENAME code help you? You can rename sequences with that... Hmm, that doesn't cover pg_attrdef.adbin. I think the best way is to create the default expressions from scratch, as To

Re: [HACKERS] Moving sequences to another schema

2005-06-27 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > I think this is done by AddRelationRawConstraints. You'd have to get > the parsetree of the default expression. I think you could get that by > applying raw_parser() to pg_attrdef.adsrc. Not adsrc --- that's not trustworthy. In practice I think you c

Re: [HACKERS] Moving sequences to another schema

2005-06-27 Thread Christopher Kings-Lynne
When altering a sequence created by a SERIAL column type (i do this by examining pg_depend to avoid moving any other sequences that are 'foreign'), i need to recreate the default expression for the SERIAL column (stored in pg_attrdef.adbin). Is there an API to do that, or do i have to recreate

Re: [HACKERS] Moving sequences to another schema

2005-06-27 Thread Alvaro Herrera
On Tue, Jun 28, 2005 at 01:43:27AM +0200, Bernd Helmle wrote: > When altering a sequence created by a SERIAL column type (i do this by > examining pg_depend to avoid moving any other sequences that are > 'foreign'), i need to recreate the default expression for the SERIAL column > (stored in pg

[HACKERS] Moving sequences to another schema

2005-06-27 Thread Bernd Helmle
I'm still playing around with the ALTER OBJECT SET SCHEMA stuff. I managed to alter indexes and constraints as well for tables, but with SERIAL sequences there is one little problem: When altering a sequence created by a SERIAL column type (i do this by examining pg_depend to avoid moving any