pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Eckermann <jeff_eckermann@yahoo.com>
To: Zlatko Matic <zlatko.matic1@sb.t-com.hr>
To: pgsql-general@postgresql.org
To: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] calculated identity field in views, again...
Date: Wed, 4 May 2005 09:01:24 -0700 (PDT)
Message-ID: <20050504160124.8942.qmail@web20822.mail.yahoo.com> (raw)

--- Zlatko Matic <zlatko.matic1@sb.t-com.hr> wrote:
> I asked this question several weeks ago, but nobody
> proposed a solution, so 
> I am repeating the same question again...
> I have an MS Access front-end for a database on
> PostgreSQL.
> I could use pass-through queries as record sources
> for reports and it works 
> fine...
> Unfortunately, MS Access doesn't allow pass-through
> queries to be records 
> sources for subforms.

Unless you use unbound form/controls.  Which means
handling everything in code, which might work out best
for you, depending on what you want (this is
effectively equivalent to the VB-only option which
someone else mentioned).

> Therefore I tried to base subforms on regular JET
> queries on linked tables. 
> It was too slow...
> Then I tried to base subforms on DAO recordset code
> generated from 
> pass-through QueryDef objects. Although it worked,
> it was very unstable...
> 
> Now it seems to me that POstgreSQL views are the
> best solution, but Access 
> considers views as tables (!) and needs column with
> unique values.

AFAIK a composite key (combination of several columns)
should work ok for a primary key for Access.  When
linking to the view, just select the columns you want
to use.  Or are you saying that you tried this, and it
didn't work?

Alternatively, you could try including in your view
definition the oid column for each of the constituent
tables.  If I understand right, oids are globally
unique within your database.  This assumes that you
have created your tables with oids, which may not be
the case.

Basing a subform on a mult-table join sounds like odd
database design.  Perhaps if you can explain more
about what you are trying to do, people can offer more
suggestions.

> All those views are complicated queries on several
> tables, so I can't use 
> any table's column as primary key. I need a
> calculated column in the view 
> that Access will consider as primary key column.
> In regular tables, I use bigserial field, but how
> can I create calculated 
> bigserial column in a view ?
> 
> Thanks. 
> 
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose
> an index scan if your
>       joining column's datatypes do not match
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



view thread (11+ messages)  latest in thread

Message-ID: <20050504160124.8942.qmail@web20822.mail.yahoo.com>
Permalink:  ../20050504160124.8942.qmail@web20822.mail.yahoo.com/
Also on:    postgresql.org/message-id/20050504160124.8942.qmail@web20822.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: jeff_eckermann@yahoo.com, zlatko.matic1@sb.t-com.hr, pgsql-general@postgresql.org
  Subject: Re: [INTERFACES] calculated identity field in views, again...
  In-Reply-To: <20050504160124.8942.qmail@web20822.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox