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

Re: [HACKERS] pg_dump, problem with user defined types?

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: emkxp01(at)mtcc(dot)demon(dot)co(dot)uk
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] pg_dump, problem with user defined types?
Date: 1998-09-24 02:10:23
Message-ID: 199809240210.WAA25411@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
> Bruce,
> 
> What I can't see from the postings, is what incident or problem
> prompted the change.
> 
> Was there test or query that failed because it chose the wrong
> procedure?
> 
> Do you have an example which failed with the old code and needed
> the changes to make it work?
> 
> I see pg_proc has "pronargs" and "proargtypes" columns, is this
> not enough to ensure that the correct procedure is called?
> 
> Or am I off at a tangent again!!

I found that the regprocin routine was doing a sequential scan of
pg_proc, looking for a function matching the supplied name, and using
the first matching entry of pg_proc.proname.

Two problems:  You can't use the system cache to look up the pg_proc
value, because the cache only does unique lookups.  Second, we have many
functions that have multiple entries in the pg_proc table with the same
name, but different arguments, so it was not really accurate.

We certainly need to change what I have done, but I am not sure how to
change it.

We can put it back to the old code, or move everything to use only an
oid, with no name, or we can somehow allow the user to supply the
pg_proc.proname, and the argument types, and do a match that way.  We
could allow just the proname if there is only one entry with that
proname.  (Sequtial scan required, but not too bad.  We could even use
the existing index.  It is not done that much.)  If it is not unique, we
would require the oid.

I hope there is some good solution.

The code currently supports input of oid, or proname_oid, and outputs
proname_oid.

-- 
  Bruce Momjian                        |  maillist(at)candle(dot)pha(dot)pa(dot)us
  830 Blythe Avenue                    |  http://www.op.net/~candle
  Drexel Hill, Pennsylvania 19026      |  (610) 353-9879(w)
  +  If your life is a hard drive,     |  (610) 853-3000(h)
  +  Christ can be your backup.        |  

In response to

Responses

pgsql-hackers by date

Next:From: Thomas G. LockhartDate: 1998-09-24 02:34:24
Subject: Re: [HACKERS] Re: [SQL] 2 questions.
Previous:From: TaralDate: 1998-09-24 01:09:49
Subject: RE: [HACKERS] Re: Results of port of Sept 18 port of PostgreSQL

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