Re: [SQL] are NEW and OLD rule attributes broken?

2001-05-18 Thread Tom Lane
Forest Wilkinson <[EMAIL PROTECTED]> writes: > What's going on here? My rule inserted a new row into bar, but the fooid > it used was not the new value inserted into foo. It looks like my rule is > inserting "nextval('foo_fooid_seq')" into the bar table, rather than > inserting the new primar

[SQL] are NEW and OLD rule attributes broken?

2001-05-18 Thread Forest Wilkinson
(Postgres 7.0.3, linux kernel 2.4.2, i386, red hat 7.1) I'm trying to build rules to automatically populate several tables with references to any new rows inserted into a primary key table. The primary key is a sequence. Here's what's going on: mydb=# create table foo (fooid serial primary

Re: [SQL] Calculating the age of a person

2001-05-18 Thread [EMAIL PROTECTED]
You are probably looking for date_part(). E.g. SELECT date_part('year',age(birth)),* FROM persons LIMIT 1; Troy > > I have a table containing the birthdays of various persons. The target > is to compute the age of a persons. > > persons=# SELECT age(birth), * FROM persons LIMIT 1; >

Re: [SQL] Inherited tables: How stable is that feature?

2001-05-18 Thread Tom Lane
Florian Weimer <[EMAIL PROTECTED]> writes: > Is it likely that table inheritance is going to be removed in future > PostgreSQL versions (or that the semantics change radically)? I doubt anyone is planning to remove it. If anything it'll get better supported. Notice that 7.1 now allows update/de

[SQL] Calculating the age of a person

2001-05-18 Thread Hans-Jürgen Schönig
I have a table containing the birthdays of various persons. The target is to compute the age of a persons. persons=# SELECT age(birth), * FROM persons LIMIT 1; age | id | name | birth| gender | income ---++++--

[SQL] Re: has anyone tried running in MAC OS X

2001-05-18 Thread Giorgio Valoti
Tom Lane wrote: > "postgresql" <[EMAIL PROTECTED]> writes: > > I guess the subject line says ithas anyone tried running > > PostgreSQL in MAC OS X. > > Some folks at Apple did. > > Postgres 7.1 is alleged to build out-of-the-box on OSX. > (But I haven't tried it myself.) Don't bother trying

[SQL] HELP: what's wrong with my PL/PSQL function??

2001-05-18 Thread Bruno Boettcher
hello! i have the following function: CREATE FUNCTION plusSum(text,int4) RETURNS int4 AS ' DECLARE jrlname ALIAS FOR $1; sumup ALIAS FOR $2; actsum int4; arow RECORD; conversion float8; temp float8; sum float8; BEGIN sum := 0; RAISE NOTICE ''stats % '', sumup; FOR arow IN

[SQL] Re: fatal ERROR running simple join query...

2001-05-18 Thread Ligia Pimentel
It didn't work. I checked the tables (both) and found nothing wrong. Finally I received an e-mail from Tom Lane suggesting that I upgraded to Postgres 7.1, wich I did. After the upgrade, everything worked just fine. Thank you. Ligia "Martín Marqués" <[EMAIL PROTECTED]> wrote in message news:[EMAI

[SQL] Help! Record logging

2001-05-18 Thread Edwin S. Ramirez
Hello, I would like to setup a trigger to keep track of all changes done onto the records of paticular tables. Basically, there would be two identical tables such as, 'medications' and 'medications_log', when a user inserts, updates or deletes a record I would like a copy to be inserted into

[SQL] Re: Please dont flame

2001-05-18 Thread Nils Zonneveld
Olivier PRENANT wrote: > > Sorry to bother, > > Just making sure my newsfeed works > > Its seems to work :-) nils ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAI

Re: [SQL] has anyone tried running in MAC OS X

2001-05-18 Thread Justin Clift
Hi, PostgreSQL 7.1.x does work on MacOS X, there's evan a MacOS X installation guide at : http://techdocs.postgresql.org/installguides.php#macosx Hope that's helpful. It's mainly focused on Apache + PHP + PostgreSQL 7.1 on MacOS X, although you should be able to make use of it. If you need fu

[SQL] Inherited tables: How stable is that feature?

2001-05-18 Thread Florian Weimer
Is it likely that table inheritance is going to be removed in future PostgreSQL versions (or that the semantics change radically)? Or can I built a database on top of this feature without running the risk of a major restructuring task in the next few years? -- Florian Weimer