pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heather Johnson <hjohnson@nypost.com>
To: pgsql-admin@postgresql.org
Cc: Harry Ford <hford@globix.com>
Cc: Serge Canizares <serge@enluminaire.com>
Cc: Marie Musacchio <marie@nypost.com>
Subject: FOLLOW UP: problems doing sub-selects on PostgreSQL 7.1.3 and Solaris 7
Date: Mon, 10 Dec 2001 17:13:06 -0500
Message-ID: <020e01c181c7$d7ebbbb0$510b10ac@sephie> (raw)

FYI--Here are the table creation statements for the tables involved in the sample query.

-- user_id_sequence
CREATE SEQUENCE user_id_sequence INCREMENT 1 START 100;

-- users
-- table for basic user data
CREATE TABLE users (

 id             INTEGER   NOT NULL PRIMARY KEY  -- unique id for each user
                DEFAULT nextval('user_id_sequence'),
 f_name         VARCHAR(128)  NOT NULL,         -- user's first name
 l_name         VARCHAR(192)  NOT NULL,         -- user's last name   
 email          VARCHAR(256)  UNIQUE NOT NULL,  -- user's email address
 password       VARCHAR(16)   NOT NULL,         -- user's password
 hint           VARCHAR(256),                   -- hint for password
 dt_registered  TIMESTAMP DEFAULT timestamp('now'),   --timestamp format is: YYYY-MM-DD HH:MM:SS-05
 user_generated_p CHAR(1)   NOT NULL            -- user-generated predicate
                  CHECK( user_generated_p IN('t', 'f')),
                                                -- true or false specified
 opt_in_p       CHAR(1)   NOT NULL              -- opt in value
                DEFAULT 't'                     -- true or false specified
                CHECK( opt_in_p IN('t', 'f'))          
);

-- user_demographics
-- table to hold user's demographics data
CREATE TABLE users_demographics (

 users_id         INTEGER    NOT NULL PRIMARY KEY  -- user's id
                  REFERENCES users(id),
 sal              VARCHAR(5) CHECK( sal IN('MR', 'MS', 'MISS', 'MRS', 'OTHER')), 
                                                    -- salutation
 addr1            VARCHAR(256),                     -- user's address line 1
 addr2            VARCHAR(256),                     -- user's address line 2
 city             VARCHAR(64),                      -- user's city
 state            CHAR(2)    NOT NULL,              -- state of residence
 zip              CHAR(5)    NOT NULL,              -- zip code
 area_code        VARCHAR(3)   NOT NULL,            -- area code
 phone            VARCHAR(15),                      -- phone number
 country          CHAR(2)    NOT NULL
                  REFERENCES country_codes(code)
                  DEFAULT 'US',  
                                                    -- country of residence
 income           VARCHAR(7)   REFERENCES income_codes(code),    
                                                    -- user's income level
 gender           CHAR(1)    NOT NULL               -- gender
                  CHECK( gender IN('m', 'f', 'u')), 
                                                    -- male or female or specified
 birth_year       INTEGER,                          -- birth year
 birth_month      INTEGER,                          -- birth month
 birth_day        INTEGER                           -- birth day
);

Message-ID: <020e01c181c7$d7ebbbb0$510b10ac@sephie>
Permalink:  ../020e01c181c7$d7ebbbb0$510b10ac@sephie/
Also on:    postgresql.org/message-id/020e01c181c7$d7ebbbb0$510b10ac@sephie

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: hjohnson@nypost.com, hford@globix.com, serge@enluminaire.com, marie@nypost.com
  Subject: Re: FOLLOW UP: problems doing sub-selects on PostgreSQL 7.1.3 and Solaris 7
  In-Reply-To: <020e01c181c7$d7ebbbb0$510b10ac@sephie>
  References: <020e01c181c7$d7ebbbb0$510b10ac@sephie>

* 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