[SQL] Need help with 'unique parents' constraint

2005-09-11 Thread Leif B. Kristensen
This message has also been posted to comp.databases. I've got a problem that I can't quite wrap my head around, about adding a constraint to my PostgreSQL genealogy database. If somebody are interested, I've written some thoughts on the general design at . I

Re: [SQL] Need help with 'unique parents' constraint

2005-09-11 Thread Leif B. Kristensen
On Sunday 11 September 2005 14:24, Leif B. Kristensen wrote: > ALTER TABLE relations ADD CONSTRAINT non_unique_father > CHECK (NOT EXISTS > (SELECT persons.person_id, relations.parent_fk > FROM persons AS P, relations AS R > WHERE R.parent_fk = P.person_id >

Re: [SQL] Need help with 'unique parents' constraint

2005-09-11 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > Now, I want to ensure that each person_id can be assigned only one > father (gender=1) and one mother (gender=2). (Yes, this is old- > fashioned, but I'm working with 18th century people). How do I do it? Not just old-fashioned, it's the biologica

[SQL] Panic: Page Add Item: Corrupted page pointers

2005-09-11 Thread The One
Hi,   I'm getting this error when try to create a table in Postgresql 7.3, windows2000:   Panic: Page Add Item: Corrupted page pointers: lower=24258, upper=39318, special=65421   LOG: statement = create table data(key unique, status text, info text) LOG: pg_recvby : unexpected EOF on client connect

Re: [SQL] Need help with 'unique parents' constraint

2005-09-11 Thread John Hasler
Greg Sabino Mullane writes: > Not just old-fashioned, [having only one mother is] the biological law! I see you aren't up on current research. -- John Hasler [EMAIL PROTECTED] Elmwood, WI USA ---(end of broadcast)--- TIP 4: Have you searched our l

Re: [SQL] Panic: PageAddItem: Corrupted page pointers

2005-09-11 Thread The One
Actually, I'm getting this error everytime I try to create a table.   Can someone please help?The One <[EMAIL PROTECTED]> wrote: Hi,   I'm getting this error when try to create a table in Postgresql 7.3, windows2000:   Panic: Page Add Item: Corrupted page pointers: lower=24258, upper=39318, specia

[SQL] showing multiple reference details from single query

2005-09-11 Thread Ferindo Middleton Jr
I have a table (table_one) with two columns, both of which are integers which reference the same column (on a one-to-many relationship) row back at another table (table_two) which has more detailed info on these integer columns: table_one has the following columns: id (SERIAL), column_one (INT

Re: [SQL] showing multiple reference details from single query

2005-09-11 Thread Michael Fuhr
On Sun, Sep 11, 2005 at 06:37:52PM -0400, Ferindo Middleton Jr wrote: > table_one has the following columns: > id (SERIAL), column_one (INTEGER REFERENCES table_two(id)), column_two > (INTEGER REFERENCES table_two(id)) > > table_two has the following columns: > id (SERIAL), more_detailed_info (TE

Re: [SQL] Panic: PageAddItem: Corrupted page pointers

2005-09-11 Thread Alvaro Herrera
On Sun, Sep 11, 2005 at 02:20:01PM -0700, The One wrote: > Actually, I'm getting this error everytime I try to create a table. > > Can someone please help? Where did you get that version of PostgreSQL? Is it the Cygwin version? AFAIK it's labelled as "not robust enough for production". > The O

Re: [SQL] Panic: Page Add Item: Corrupted page pointers

2005-09-11 Thread Tom Lane
The One <[EMAIL PROTECTED]> writes: > I'm getting this error when try to create a table in Postgresql 7.3, > windows2000: > Panic: Page Add Item: Corrupted page pointers: lower=24258, upper=39318, > special=65421 Apparently you've got at least one corrupt page in at least one system table. I'

[SQL] howto insert dynamic value

2005-09-11 Thread liofr
hi i want to put the actual date in cell what is the name of the functrion to do that (date()) ? thnak's ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] howto insert dynamic value

2005-09-11 Thread Michael Fuhr
On Mon, Sep 12, 2005 at 04:19:14AM +0200, liofr wrote: > i want to put the actual date in cell > what is the name of the functrion to do that (date()) ? See "Date/Time Functions and Operators" in the "Functions and Operators" chapter of the documentation. Here's a link to the latest version: htt

Re: [SQL] howto insert dynamic value

2005-09-11 Thread wendell
http://www.postgresql.org/docs/7.3/interactive/functions-datetime.html - Original Message - From: liofr To: pgsql-sql@postgresql.org Sent: Monday, September 12, 2005 10:19 AM Subject: [SQL] howto insert dynamic value hii want to put the actual date in cellwhat is