I have a database in which five separate tables may (or may not) reference
any given row in a table of postal addresses. I am using the primary /
foreign key support in postgres 7 to represent these references.
My problem is that, any time a reference is removed (either by deleting or
updating a
Stuff like this is possible in 7.1:
SELECT m.name, m.length, count(r.rating) AS fives
FROM movies m LEFT JOIN (SELECT * FROM ratings WHERE rating = 5) AS r
ON m.name = r.name
GROUP BY m.name, m.length;
I think that would work. You'd want to try different queries with EXPLAIN to
see what looks
Yury Don wrote:
> If I understand correctly it must looks like this:
> SELECT name, length,
> (SELECT count(*)
>FROM ratings
>WHERE rating='5'
>and rating.name=movies.name) as fives
> FROM movies
> WHERE name=rname;
This results in several rows for eac
Josh Berkus wrote:
> Najm,
>
> > references age_list(id);
> > And I get the following error:
> > flipr=# alter table users
> > flipr-# add constraint age_fk foreign key(age) references
> > age_list(id);
> > NOTICE: ALTER TABLE ... ADD CONSTRAINT will create
> > implicit trigger(s)
> > for FOREIG
Najm,
> references age_list(id);
> And I get the following error:
> flipr=# alter table users
> flipr-# add constraint age_fk foreign key(age) references
> age_list(id);
> NOTICE: ALTER TABLE ... ADD CONSTRAINT will create
> implicit trigger(s)
> for FOREIGN KEY check(s)
> ERROR: referential i
Hi All,
What is the correct syntax for adding a foreign key constraint from the
command line.
I am using v7.1 beta3. I am doing the follwoing:
alter table users
add constraint age_fk foreign key(age)
references age_list(id);
And I get th
Hello,
I have visited your web site and found very interesting and informative.
I would like to know:
What is a BLOB Field and can you give a example of one?
I hope to hear from you soon
Get your small business started at Lycos Small Business at
http://www.lycos.com/business/mail.html
"Aleksey V. Kurinov" <[EMAIL PROTECTED]> writes:
> Does Postrges provide "Select * from Select * from t1" construction ?
In 7.1.
But you have to spell it per the SQL spec:
select * from (select * from t1) as foo;
The parentheses and alias name are not optional.
Ramesh H R wrote:
>Hello everyone,
>Please can anyone tell me, where i can get Pgaccess query tool
It is in the PostgreSQL source at src/bin/pgaccess/
See also http://www.flex.ro/pgaccess
--
Oliver Elphick[EMAIL PROTECTED]
Isle of Wight
Thus spake guard
> how to run "select from databaseA:tabl1 ,databaseB:table2 "
You can't. You have to have two databases open and do it yourself. I use
Python and often do things like this.
import pg
adb = pg.DB('dbase_a')
bdb = pg.DB('dbase_b')
row = adb.get('table_a', 1)# second argumen
Hello everyone,
Please can anyone tell me, where i can get Pgaccess query tool
Regards,
--
Ramesh HR
Trainee Engineer
EASi Technologies
213, 3rd Main, 4th Cross
Chamrajpet, Bangalore - 560 018
India
Ph.: 660 1086 / 660 2365 / 667 2984 Extn.: 155
Facsimile: 667 5274
www.easi.soft.net
On Thu, 18 Jan 2001, Stephan Szabo wrote:
> Well, you should have gotten an error message from the statement that was
> in error in any case, but maybe a message on the commit/end that says
> that the transaction was aborted due to errors would be nice.
Or both.
Zoltan
Sorry for lack of proper quoting, you might find it useful to
From: "Sharmad Naik" <[EMAIL PROTECTED]>
I m sorry If anyone has already asked this Q earlier
I wanted to know
Q1. Whether I can have another key on which the table is indexed even though
i have a primary key..Then how would the
Hello Jussi,
Once, Friday, January 19, 2001, 12:34:50 PM, you wrote:
JV> I have the following two tables:
JV> create table movies (
JV> name varchar(80),
JV> info varchar(80),
JV> length int,
JV> primary key (name)
JV> );
JV> create table ratings (
JV> name varchar(80),
JV> userid
Jussi Vainionpää <[EMAIL PROTECTED]> writes:
> SELECT name, length, fives
> FROM movies,
>(SELECT name as rname,
>count(*) as fives
> FROM ratings
> WHERE rating='5'
> GROUP BY name)
> WHERE name=rname;
>
> but in PostgreSQL 7 it just giv
I have the following two tables:
create table movies (
name varchar(80),
info varchar(80),
length int,
primary key (name)
);
create table ratings (
name varchar(80),
userid varchar(10),
rating char(1),
foreign key (name) references movies,
primary key(name, userid)
);
The tabl
Hi, All !!
Does Postrges provide "Select * from Select * from t1" construction ?
I use Postrges v.7.0.3 and get
"ERROR: parser: parse error at or near "select" response for such request.
Thanks, Leksey
Maybe a wrong mailinglist to ask this, but...
Are there any plans on writing a chapter in the documentation about the implementation
of indices. I know from M$ SQL Server that it is no picnic determining which indices
are useful, and thick books can be written on how to make the right indices f
I m sorry If anyone has already asked this Q
earlier
I wanted to know
Q1. Whether I can have another key on which the
table is indexed even though i have a primary key..Then how would the data
be accessed according to primary key or the indexed key of my choice or i can
index as per m
19 matches
Mail list logo