Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-05-11 Thread Tom Lane
Awhile back I wrote: I did some tests just now to determine the total number of catalog entries associated with a simple table definition. Assuming it has N user columns of built-in types (hence not requiring pg_depend entries for the datatypes), I count 1 pg_class entry for the table

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-05-11 Thread Merlin Moncure
On 5/11/07, Tom Lane [EMAIL PROTECTED] wrote: BTW, in the array patch as just committed, I was able to get rid of the I am testing this feature, no problem so far. It's fast, and works exactly as advertised! Great work! (aiui, no domain arrays for 8.3?) merlin

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-05-06 Thread Andrew Dunstan
I wrote: OK, summarising what looks to me like a consensus position, ISTM the plan could be: . fix makeArrayTypeName() or similar to make it try harder to generate a unique non-clashing name . remove the existing 62 instead of 63 name length restrictions . autogenerate array types for

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-05-06 Thread David Fetter
On Sun, May 06, 2007 at 01:33:47PM -0400, Andrew Dunstan wrote: However, there are still some oddities. For example, a change to or removal of the base type affects the array type, but the array type can be directly operated on (e.g. alter type _aa set schema foo ). I'm inclined to say we

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-09 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan [EMAIL PROTECTED] writes: How would we do that? Not create the array types in bootstrap mode? Or just special-case pg_statistic? Not generate them in bootstrap mode works for me. IIRC, there's code somewhere in there that allows anyarray to pass as a

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-09 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: Regarding catalog objects, we might have to try a little harder than just not generating in bootstrap mode - IIRC we generate system views (including pg_stats) in non-bootstrap mode. Maybe we just need to exempt anything in the pg_catalog namespace.

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-09 Thread David Fetter
On Mon, Apr 09, 2007 at 10:40:49AM -0400, Tom Lane wrote: Andrew Dunstan [EMAIL PROTECTED] writes: Regarding catalog objects, we might have to try a little harder than just not generating in bootstrap mode - IIRC we generate system views (including pg_stats) in non-bootstrap mode. Maybe

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-09 Thread Martijn van Oosterhout
On Mon, Apr 09, 2007 at 10:14:41AM -0400, Andrew Dunstan wrote: . defer for the present any consideration of a CREATE TYPE foo AS ARRAY ... command. What is the rationale for allowing people to name the array type. When I originally proposed the syntax I presumed that the array name would be

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-09 Thread Andrew Dunstan
Martijn van Oosterhout wrote: On Mon, Apr 09, 2007 at 10:14:41AM -0400, Andrew Dunstan wrote: . defer for the present any consideration of a CREATE TYPE foo AS ARRAY ... command. What is the rationale for allowing people to name the array type. When I originally proposed the syntax I

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-09 Thread Martijn van Oosterhout
On Mon, Apr 09, 2007 at 04:07:16PM -0400, Andrew Dunstan wrote: Some type systems have named array types, some don't. I can live happily with either. Are array types anonymous in the standard? Yes, they're anonymous in the standard. That doesn't mean we can't give them names if we wanted...

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-08 Thread Andrew Dunstan
Tom Lane wrote: David Fetter [EMAIL PROTECTED] writes: On Mon, Apr 02, 2007 at 10:01:44PM -0400, Alvaro Herrera wrote: So, hum, what happened to the idea of creating the array types only on demand? Scotched, as far as I could tell, More like you submitted a patch

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-08 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: One of the things that's been bothering me about this proposal is that it leaves untouched and indeed greatly expands the scope of the typename mangling we do. (i.e. adding an entry to pg_type with _ prepended). Yeah, that's been bothering me too.

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-08 Thread David Fetter
On Sun, Apr 08, 2007 at 07:08:38PM -0400, Tom Lane wrote: Andrew Dunstan [EMAIL PROTECTED] writes: One of the things that's been bothering me about this proposal is that it leaves untouched and indeed greatly expands the scope of the typename mangling we do. (i.e. adding an entry to

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-08 Thread Andrew Dunstan
Tom Lane wrote: I've been thinking of proposing that we add a column to pg_type that points from a type to its array type (if any), ie the reverse link from typelem. If we had that then the parser could follow that to determine which type is foo[], instead of relying on the _foo naming

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-08 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: Tom Lane wrote: I don't suggest that we stop using the naming convention, but it would no longer be a hard-and-fast rule, just a convention. In particular we could rejigger things around the edges to reduce the name conflict problem. For instance the

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-08 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan [EMAIL PROTECTED] writes: Tom Lane wrote: I don't suggest that we stop using the naming convention, but it would no longer be a hard-and-fast rule, just a convention. In particular we could rejigger things around the edges to reduce the name conflict

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-08 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: I'm slightly inclined to agree with David that the danger of catalog bloat isn't that great, and might not justify the extra work that some sort of explicit array creation would involve (e.g. changes in grammar, pg_dump), as long as we are agreed

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-08 Thread Andrew Dunstan
Tom Lane wrote: Based on this, I withdraw my efficiency concern about generating rowtypes for all user tables. I do, however, still object to generating them for system tables. In particular an array type for pg_statistic will actively Not Work and probably constitute a security hole, because

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-08 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: How would we do that? Not create the array types in bootstrap mode? Or just special-case pg_statistic? Not generate them in bootstrap mode works for me. IIRC, there's code somewhere in there that allows anyarray to pass as a column type in bootstrap

Re: [HACKERS] Arrays of Complex Types

2007-04-03 Thread David Fetter
On Mon, Apr 02, 2007 at 10:01:44PM -0400, Alvaro Herrera wrote: Bruce Momjian wrote: Your patch has been added to the PostgreSQL unapplied patches list at: http://momjian.postgresql.org/cgi-bin/pgpatches It will be applied as soon as one of the PostgreSQL committers reviews

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-03 Thread Tom Lane
David Fetter [EMAIL PROTECTED] writes: On Mon, Apr 02, 2007 at 10:01:44PM -0400, Alvaro Herrera wrote: So, hum, what happened to the idea of creating the array types only on demand? Scotched, as far as I could tell, More like you submitted a patch that entirely ignores multiple people's

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-03 Thread David Fetter
On Tue, Apr 03, 2007 at 02:30:07AM -0400, Tom Lane wrote: David Fetter [EMAIL PROTECTED] writes: On Mon, Apr 02, 2007 at 10:01:44PM -0400, Alvaro Herrera wrote: So, hum, what happened to the idea of creating the array types only on demand? Scotched, as far as I could tell, More like

Re: [PATCHES] [HACKERS] Arrays of Complex Types

2007-04-03 Thread Bruce Momjian
Tom Lane wrote: David Fetter [EMAIL PROTECTED] writes: On Mon, Apr 02, 2007 at 10:01:44PM -0400, Alvaro Herrera wrote: So, hum, what happened to the idea of creating the array types only on demand? Scotched, as far as I could tell, More like you submitted a patch that entirely

Re: [HACKERS] Arrays of Complex Types

2007-04-02 Thread David Fetter
On Fri, Mar 30, 2007 at 05:08:42PM -0400, Tom Lane wrote: David Fetter [EMAIL PROTECTED] writes: After several rounds of patches, it appears that it might be easier to create a new typtype entry, which I'll tentatively call 'a' because it seems a little fragile and a lot inelegant and hard

Re: [HACKERS] Arrays of Complex Types

2007-04-02 Thread Bruce Momjian
Your patch has been added to the PostgreSQL unapplied patches list at: http://momjian.postgresql.org/cgi-bin/pgpatches It will be applied as soon as one of the PostgreSQL committers reviews and approves it. ---

Re: [HACKERS] Arrays of Complex Types

2007-04-02 Thread Alvaro Herrera
Bruce Momjian wrote: Your patch has been added to the PostgreSQL unapplied patches list at: http://momjian.postgresql.org/cgi-bin/pgpatches It will be applied as soon as one of the PostgreSQL committers reviews and approves it. So, hum, what happened to the idea of creating the

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Peter Eisentraut
Tom Lane wrote: Why not enums? ;-) Well, macros is how we do it elsewhere for char system columns. I'm not sure we could rely on the behavior if we declared pg_type.typtype as an enum type ... and if we don't, there's not much point. I was thinking C enums: enum typtype_type {

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes: Tom Lane wrote: I'm not sure we could rely on the behavior if we declared pg_type.typtype as an enum type ... and if we don't, there's not much point. I was thinking C enums: enum typtype_type { TYPTYPE_BASE = 'b', TYPTYPE_COMPOSITE

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Peter Eisentraut
Tom Lane wrote: What bothers me about that is I don't think the C spec mandates the representation width. If we could guarantee that enum typtype_type was 1 byte I'd be all for it. The width is 4 both for the macro and the enum case. Both #define TYPTYPE_BASE 'b' and enum ... {

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Gregory Stark
Peter Eisentraut [EMAIL PROTECTED] writes: Tom Lane wrote: What bothers me about that is I don't think the C spec mandates the representation width. If we could guarantee that enum typtype_type was 1 byte I'd be all for it. The width is 4 both for the macro and the enum case. Both

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Peter Eisentraut
Gregory Stark wrote: The width is 4 both for the macro and the enum case.  Both #define TYPTYPE_BASE 'b' and enum ... {   TYPTYPE_BASE = 'b', effectively generate int constants named TYPTYPE_BASE with decimal value 98.  So there are no storage advantages either way.

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: We could use enum {} to define the labels and then make a rule that all actual variables should be declared using char rather than declaring them as enum typtype. But I fear somebody would get that wrong some day. Yeah, that seems to me to be just

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Peter Eisentraut
Tom Lane wrote: It seems clear to me that this authorizes, but *does not require*, the compiler to store an enum field in a byte or short instead of an int when all the declared values will fit.  So if we tried to do this, we'd have the problem of needing compiler-specific data type

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes: Tom Lane wrote: It seems clear to me that this authorizes, but *does not require*, the compiler to store an enum field in a byte or short instead of an int when all the declared values will fit. FWIW, I never meant to suggest using enums tuple

Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-03-31 Thread Tom Lane
I wrote: David Fetter [EMAIL PROTECTED] writes: What parts of the code would need a once-over? A lot :-( ... probably every place that touches typtype or typelem would need at least a look. It'd be a good idea to take the opportunity to start using macros for the values of typtype, as we

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-03-31 Thread Bruce Momjian
Tom Lane wrote: I wrote: David Fetter [EMAIL PROTECTED] writes: What parts of the code would need a once-over? A lot :-( ... probably every place that touches typtype or typelem would need at least a look. It'd be a good idea to take the opportunity to start using macros for the

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-03-31 Thread David Fetter
On Sat, Mar 31, 2007 at 07:13:20PM -0400, Bruce Momjian wrote: Tom Lane wrote: I wrote: David Fetter [EMAIL PROTECTED] writes: What parts of the code would need a once-over? A lot :-( ... probably every place that touches typtype or typelem would need at least a look. It'd be

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-03-31 Thread Tom Lane
David Fetter [EMAIL PROTECTED] writes: What say we put one in pre-emptively for TYPTYPE_ARRAY? When and if the patch appears, you can add it ;-). I'm just intending a search-and-replace at the moment. regards, tom lane ---(end of

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-03-31 Thread David Fetter
On Sat, Mar 31, 2007 at 07:58:34PM -0400, Tom Lane wrote: David Fetter [EMAIL PROTECTED] writes: What say we put one in pre-emptively for TYPTYPE_ARRAY? When and if the patch appears, you can add it ;-). I'm just intending a search-and-replace at the moment. Like this? Cheers, D --

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-03-31 Thread Peter Eisentraut
Bruce Momjian wrote: I just realized that I need to check every usage of typtype to be sure that the enums patch is sane. So, barring objection, I intend to take this opportunity to make the code stop referring directly to 'b', 'c' etc whereever possible. Any objections to these names?

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-03-31 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes: I just realized that I need to check every usage of typtype to be sure that the enums patch is sane. So, barring objection, I intend to take this opportunity to make the code stop referring directly to 'b', 'c' etc whereever possible. Any objections

Re: [HACKERS] Arrays of Complex Types

2007-03-30 Thread David Fetter
On Fri, Mar 02, 2007 at 03:40:16PM -0800, David Fetter wrote: Folks, I'd like to take the TODO item that reads, Add support for arrays of complex types, but before I start patching, I'd like to see whether what I'm about to do makes any sense: After several rounds of patches, it appears

Re: [HACKERS] Arrays of Complex Types

2007-03-30 Thread Tom Lane
David Fetter [EMAIL PROTECTED] writes: After several rounds of patches, it appears that it might be easier to create a new typtype entry, which I'll tentatively call 'a' because it seems a little fragile and a lot inelegant and hard to maintain to have typtype='c' and typrelid=InvalidOid mean,

Re: [HACKERS] Arrays of Complex Types

2007-03-28 Thread Andrew - Supernews
On 2007-03-27, David Fetter [EMAIL PROTECTED] wrote: Per further discussion with Andrew of Supernews and Merlin Moncure, I've added a check for compound types and moved the creation of the array type from DefineRelation in backend/commands/tablecmds.c to heap_create_with_catalog in

Re: [HACKERS] Arrays of Complex Types

2007-03-28 Thread David Fetter
On Wed, Mar 28, 2007 at 07:05:24AM -, Andrew - Supernews wrote: On 2007-03-27, David Fetter [EMAIL PROTECTED] wrote: Per further discussion with Andrew of Supernews and Merlin Moncure, I've added a check for compound types and moved the creation of the array type from DefineRelation in

Re: [HACKERS] Arrays of Complex Types

2007-03-28 Thread Alvaro Herrera
David Fetter wrote: The first is in type_sanity, which basically doesn't understand that complex types now have array types associated with them and thinks they're orphan array types, so it's actually the test that's not right. Hmm, I question the usefulness of automatically creating array

Re: [HACKERS] Arrays of Complex Types

2007-03-28 Thread Andrew Dunstan
Alvaro Herrera wrote: David Fetter wrote: The first is in type_sanity, which basically doesn't understand that complex types now have array types associated with them and thinks they're orphan array types, so it's actually the test that's not right. Hmm, I question the usefulness of

Re: [HACKERS] Arrays of Complex Types

2007-03-28 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Hmm, I question the usefulness of automatically creating array types for all relation types that are created -- the catalog bloat seems a bit too much. An array of pg_autovacuum for example, does that make sense? Not only that, it won't even work for

Re: [HACKERS] Arrays of Complex Types

2007-03-28 Thread David Fetter
On Wed, Mar 28, 2007 at 01:33:56PM -0400, Andrew Dunstan wrote: Alvaro Herrera wrote: David Fetter wrote: The first is in type_sanity, which basically doesn't understand that complex types now have array types associated with them and thinks they're orphan array types, so it's actually the

Re: [HACKERS] Arrays of Complex Types

2007-03-28 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: CREATE ARRAY TYPE FOR foo I also made a suggestion along the way that we never create array types automatically except for domains. Ie, we don't need a new command, we just document that what you do if you want to create an array of something is create

Re: [HACKERS] Arrays of Complex Types

2007-03-28 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: Tom Lane [EMAIL PROTECTED] writes: CREATE ARRAY TYPE FOR foo I also made a suggestion along the way that we never create array types automatically except for domains. That seems awfully strange, not to mention very non-backwards-compatible since it

Re: [HACKERS] Arrays of Complex Types

2007-03-28 Thread David Fetter
On Wed, Mar 28, 2007 at 03:24:26PM -0400, Tom Lane wrote: Gregory Stark [EMAIL PROTECTED] writes: Tom Lane [EMAIL PROTECTED] writes: CREATE ARRAY TYPE FOR foo I also made a suggestion along the way that we never create array types automatically except for domains. That seems awfully

Re: [HACKERS] Arrays of Complex Types

2007-03-27 Thread David Fetter
On Tue, Mar 27, 2007 at 11:08:44AM -0700, David Fetter wrote: On Sun, Mar 25, 2007 at 10:18:14PM -0400, Tom Lane wrote: David Fetter [EMAIL PROTECTED] writes: I've written up a patch intended to implement this on the non-pg_catalog tables and VIEWs, but while it builds, it doesn't

Re: [HACKERS] Arrays of Complex Types

2007-03-27 Thread Andrew Dunstan
David Fetter wrote: It now initdb's successfully, but fails on a lot of regression tests. Please find attached the new patch vs. CVS TIP and the regression test output. The regression test output is useless without seeing the regression diffs. cheers andrew

Re: [HACKERS] Arrays of Complex Types

2007-03-27 Thread David Fetter
On Sun, Mar 25, 2007 at 10:18:14PM -0400, Tom Lane wrote: David Fetter [EMAIL PROTECTED] writes: I've written up a patch intended to implement this on the non-pg_catalog tables and VIEWs, but while it builds, it doesn't initdb. Enclosed are the patch and the error log. Any hints as to

Re: [HACKERS] Arrays of Complex Types

2007-03-25 Thread David Fetter
I wrote: I'd like to take the TODO item that reads, Add support for arrays of complex types, but before I start patching, I'd like to see whether what I'm about to do makes any sense: I've written up a patch intended to implement this on the non-pg_catalog tables and VIEWs, but while it

Re: [HACKERS] Arrays of Complex Types

2007-03-25 Thread Tom Lane
David Fetter [EMAIL PROTECTED] writes: I've written up a patch intended to implement this on the non-pg_catalog tables and VIEWs, but while it builds, it doesn't initdb. Enclosed are the patch and the error log. Any hints as to what I might look at? creating template1 database in

Re: [HACKERS] Arrays of Complex Types

2007-03-06 Thread David Fetter
On Fri, Mar 02, 2007 at 06:59:50PM -0500, Tom Lane wrote: David Fetter [EMAIL PROTECTED] writes: 1. In src/backend/commands/tablecmds.c, change DefineRelation as follows: * After the first call to heap_create_with_catalog, construct and do another call to for the array type.

Re: [HACKERS] Arrays of Complex Types

2007-03-06 Thread Tom Lane
David Fetter [EMAIL PROTECTED] writes: I noticed something in src/backend/commands/tablecmds.c which worries me, namely that it ignores functions and views. What? regards, tom lane ---(end of broadcast)--- TIP 3: Have you

Re: [HACKERS] Arrays of Complex Types

2007-03-06 Thread David Fetter
On Tue, Mar 06, 2007 at 04:14:07PM -0500, Tom Lane wrote: David Fetter [EMAIL PROTECTED] writes: I noticed something in src/backend/commands/tablecmds.c which worries me, namely that it ignores functions and views. What? The it in question is, find_composite_type_dependencies() Cheers, D

Re: [HACKERS] Arrays of Complex Types

2007-03-06 Thread Tom Lane
David Fetter [EMAIL PROTECTED] writes: On Tue, Mar 06, 2007 at 04:14:07PM -0500, Tom Lane wrote: David Fetter [EMAIL PROTECTED] writes: I noticed something in src/backend/commands/tablecmds.c which worries me, namely that it ignores functions and views. What? The it in question is,

Re: [HACKERS] Arrays of Complex Types

2007-03-06 Thread David Fetter
On Tue, Mar 06, 2007 at 04:24:36PM -0500, Tom Lane wrote: David Fetter [EMAIL PROTECTED] writes: On Tue, Mar 06, 2007 at 04:14:07PM -0500, Tom Lane wrote: David Fetter [EMAIL PROTECTED] writes: I noticed something in src/backend/commands/tablecmds.c which worries me, namely that it

Re: [HACKERS] Arrays of Complex Types

2007-03-03 Thread Martijn van Oosterhout
On Fri, Mar 02, 2007 at 06:42:14PM -0600, Andrew Dunstan wrote: I'm still not happy about the idea of doing this for every relation (and doing it for sequences and indexes would be the height of wastefulness). How about we only do it for composite types? I'm not happy about that. I agree

Re: [HACKERS] Arrays of Complex Types

2007-03-03 Thread Andrew Dunstan
Martijn van Oosterhout wrote: On Fri, Mar 02, 2007 at 06:42:14PM -0600, Andrew Dunstan wrote: I'm still not happy about the idea of doing this for every relation (and doing it for sequences and indexes would be the height of wastefulness). How about we only do it for composite types?

Re: [HACKERS] Arrays of Complex Types

2007-03-03 Thread David Fetter
On Sat, Mar 03, 2007 at 09:06:11AM -0500, Andrew Dunstan wrote: Martijn van Oosterhout wrote: On Fri, Mar 02, 2007 at 06:42:14PM -0600, Andrew Dunstan wrote: I'm still not happy about the idea of doing this for every relation (and doing it for sequences and indexes would be the height

Re: [HACKERS] Arrays of Complex Types

2007-03-03 Thread Gregory Stark
David Fetter [EMAIL PROTECTED] writes: 2. Make a command: CREATE TYPE ARRAY OF foo; The latter has the benefit of not restricting it to an arbitrary choice of types, you could accept both domains and composite types here. I'm thinking that DOMAINs over simple types should just

Re: [HACKERS] Arrays of Complex Types

2007-03-03 Thread Andrew Dunstan
David Fetter wrote: Per your earlier suggestion in IRC, I'm picturing a polymorphic function like pg_catalog.array_for(typepoid OID) pg_catalog.array_for(typename NAME) pg_catalog.array_for(typenamespace NAME, typename NAME) I don't see a good reason to allow putting array types in a different

[HACKERS] Arrays of Complex Types

2007-03-02 Thread David Fetter
Folks, I'd like to take the TODO item that reads, Add support for arrays of complex types, but before I start patching, I'd like to see whether what I'm about to do makes any sense: 1. In src/backend/commands/tablecmds.c, change DefineRelation as follows: * After the first call to

Re: [HACKERS] Arrays of Complex Types

2007-03-02 Thread Tom Lane
David Fetter [EMAIL PROTECTED] writes: 1. In src/backend/commands/tablecmds.c, change DefineRelation as follows: * After the first call to heap_create_with_catalog, construct and do another call to for the array type. I'm still not happy about the idea of doing this for every

Re: [HACKERS] Arrays of Complex Types

2007-03-02 Thread Andrew Dunstan
Tom Lane wrote: David Fetter [EMAIL PROTECTED] writes: 1. In src/backend/commands/tablecmds.c, change DefineRelation as follows: * After the first call to heap_create_with_catalog, construct and do another call to for the array type. I'm still not happy about the idea of doing