pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alex Rice <alrice@ARCplanning.com>
To: chester c young <chestercyoung@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: does this require a stored procedure?
Date: Thu, 8 May 2003 13:44:49 -0600
Message-ID: <8766F03B-818D-11D7-A998-000393529642@ARCplanning.com> (raw)
In-Reply-To: <20030508192633.41386.qmail@web12701.mail.yahoo.com>


On Thursday, May 8, 2003, at 01:26  PM, chester c young wrote:

> do you mean something like:
>
>  select t.url_id, t.url as title_url, t.sval as title_val,
>     c.url as content_url, c.sval as content_val
>  from
>     (select * from urlinfo where sname = 'title') t
>  join
>     (select * from urlinfo where sname = 'Content-type') c
>  using( url_id );
>

Chester. Thanks, this helpful. However I think a stored procedure might  
be the way to go.  See the url string exists only in the url table.  
Also the primary key is named url_id or rec_id depending which table,  
so the using(url_id) wouldn't work for that join.

mnogosearch=> \d url
                                  Table "public.url"
      Column      |       Type       |                   Modifiers

-----------------+------------------ 
+-------------------------------------------
----
  rec_id          | integer          | not null default  
nextval('next_url_id'::te
xt)
  status          | integer          | not null default 0
  docsize         | integer          | not null default 0
  next_index_time | integer          | not null
  last_mod_time   | integer          |
  referrer        | integer          | not null default 0
  hops            | integer          | not null default 0
  crc32           | integer          | not null default 0
  seed            | integer          | not null default 0
  bad_since_time  | integer          |
  site_id         | integer          |
  server_id       | integer          |
  pop_rank        | double precision | not null default 0
  url             | text             | not null

mnogosearch=> \d urlinfo
     Table "public.urlinfo"
  Column |  Type   | Modifiers
--------+---------+-----------
  url_id | integer | not null
  sname  | text    | not null
  sval   | text    | not null
Indexes: urlinfo_id btree (url_id)



Alex Rice, Software Developer
Architectural Research Consultants, Inc.
alrice@ARCplanning.com
alrice@swcp.com




view thread (4+ messages)  latest in thread

Message-ID: <8766F03B-818D-11D7-A998-000393529642@ARCplanning.com>
Permalink:  ../8766F03B-818D-11D7-A998-000393529642@ARCplanning.com/
Also on:    postgresql.org/message-id/8766F03B-818D-11D7-A998-000393529642@ARCplanning.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-sql@postgresql.org
  Cc: alrice@ARCplanning.com, chestercyoung@yahoo.com
  Subject: Re: does this require a stored procedure?
  In-Reply-To: <8766F03B-818D-11D7-A998-000393529642@ARCplanning.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