Skip site navigation (1) Skip section navigation (2)

Re: using composite types in insert/update

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: using composite types in insert/update
Date: 2009-01-30 20:12:34
Message-ID: 20090130201233.GA3008@frubble.xen.chris-lamb.co.uk (view raw or flat)
Thread:
Lists: pgsql-hackers
On Fri, Jan 30, 2009 at 02:47:49PM -0500, Merlin Moncure wrote:
> On 1/30/09, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Merlin Moncure <mmoncure(at)gmail(dot)com> writes:
> >  > You are missing the point, using the composite type allows you to
> >  > build the insert without knowing the specific layout of the
> >  > table...
> >
> > Surely at *some* level you have to know that.
> 
> You don't (if I understand your meaning) ...you just have to make sure
> the destination of the insert is the same as the source.

Sounds as though there are at least two levels that know the specific
layout of the tables involved then.  1) PG has to know the structure of
the tables, and 2) you application relies on the fact that tables of the
same name have the same structure.  Sounds like a very simple ah-hoc
nominal type system to me.

-- 
  Sam  http://samason.me.uk/

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2009-01-30 20:25:42
Subject: Re: parallel restore
Previous:From: Merlin MoncureDate: 2009-01-30 20:12:27
Subject: Re: using composite types in insert/update

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group