Thread: Re: Request for qualified column names

Re: Request for qualified column names

From
Bruce Momjian
Date:
Dave Cramer says it is needed for the jdbc spec, somehow. It seems kind
of odd so I don't want to make too complex an implementation.

---------------------------------------------------------------------------

Peter Eisentraut wrote:
> Bruce Momjian writes:
> 
> > My idea on this after chat with Dave was to add a GUC option that puts
> > the schema.table.column name as the default column label, rather than
> > just the column name.
> 
> Can someone explain why this is needed at all?  There is a reason why the
> SQL standard does not provide for this information: it's not well defined.
> Are you trying to make up a poor substitute for updatable views?
> 
> -- 
> Peter Eisentraut   peter_e@gmx.net
> 
> 

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


Re: Request for qualified column names

From
"Reggie Burnett"
Date:
What is needed, at least from my perspective, is a way to determine
proper meta data for a given column.  Is it updatable?  Is it nullable?
Is it part of a primary key or index?  Without either the base table
name or attrelid,indrelid of the table, I can't get this info.

Reggie

> -----Original Message-----
> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
> Sent: Tuesday, January 28, 2003 4:01 PM
> To: Peter Eisentraut
> Cc: Tom Lane; Reggie Burnett; 'Dave Cramer'; 'PostgreSQL Hackers
Mailing
> List'
> Subject: Re: [HACKERS] Request for qualified column names
> 
> 
> Dave Cramer says it is needed for the jdbc spec, somehow. It seems
kind
> of odd so I don't want to make too complex an implementation.
> 
>
------------------------------------------------------------------------
--
> -
> 
> Peter Eisentraut wrote:
> > Bruce Momjian writes:
> >
> > > My idea on this after chat with Dave was to add a GUC option that
puts
> > > the schema.table.column name as the default column label, rather
than
> > > just the column name.
> >
> > Can someone explain why this is needed at all?  There is a reason
why
> the
> > SQL standard does not provide for this information: it's not well
> defined.
> > Are you trying to make up a poor substitute for updatable views?
> >
> > --
> > Peter Eisentraut   peter_e@gmx.net
> >
> >
> 
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 359-1001
>   +  If your life is a hard drive,     |  13 Roberts Road
>   +  Christ can be your backup.        |  Newtown Square, Pennsylvania
> 19073




Re: Request for qualified column names

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Dave Cramer says it is needed for the jdbc spec, somehow.

Does the JDBC spec really require the database to provide functionality
that's not in the SQL spec?  I kinda doubt that.
        regards, tom lane


Re: Request for qualified column names

From
Dave Cramer
Date:
The method in question is

ResultSetMetaDate.getTableName(int column)
and while were at it

ResultSetMetaData.getSchemaName(int column)

and FWIW, the return value if not applicable is ""


Dave
On Tue, 2003-01-28 at 17:21, Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Dave Cramer says it is needed for the jdbc spec, somehow.
> 
> Does the JDBC spec really require the database to provide functionality
> that's not in the SQL spec?  I kinda doubt that.
> 
>             regards, tom lane
-- 
Dave Cramer <dave@fastcrypt.com>
Cramer Consulting



Re: Request for qualified column names

From
Peter Eisentraut
Date:
Dave Cramer writes:

> The method in question is
> ResultSetMetaDate.getTableName(int column)
> and while were at it
> ResultSetMetaData.getSchemaName(int column)
> and FWIW, the return value if not applicable is ""

Not applicable sounds fine to me.  It's like taking a file descriptor and
asking what file it belongs to.  That information simply doesn't exist,
and if you design an application around it you lose.

-- 
Peter Eisentraut   peter_e@gmx.net



Re: Request for qualified column names

From
Bruce Momjian
Date:
Peter Eisentraut wrote:
> Dave Cramer writes:
> 
> > The method in question is
> > ResultSetMetaDate.getTableName(int column)
> > and while were at it
> > ResultSetMetaData.getSchemaName(int column)
> > and FWIW, the return value if not applicable is ""
> 
> Not applicable sounds fine to me.  It's like taking a file descriptor and
> asking what file it belongs to.  That information simply doesn't exist,
> and if you design an application around it you lose.

Yes, but in cases we can supply the info with the proper GUC variable
enabled, why not do it?   I realize most people don't want it, but if
jdbc does, and it is something folks would use, maybe we should enable
it for the easy cases.

However, the number of cases where we would not be able to easily report
it may make the feature useless.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073