Re: [SQL] [GENERAL] lost in system tables

2005-12-06 Thread Emil Rachovsky
> Those parameters are specified when you declare the > foreign key. Look here, > in the section describing "references": > http://www.postgresql.org/docs/8.1/interactive/sql-createtable.html > > Luca Thank you,Luca I know that these parameters are specified when you declare the foreign key, bu

Re: [SQL] lost in system tables

2005-12-06 Thread Emil Rachovsky
Thank you,Tom, As for the description of 'nulls' I have taken it as it is from the Sybase help file :) __ Yahoo! DSL – Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com ---(end of broad

Re: [SQL] Date Interval

2005-12-06 Thread Magdalena Komorowska
It works great, very nice method :-) thanks a lot! MK ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Date Interval

2005-12-06 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, Bruce Momjian writes: > Magdalena Komorowska wrote: >> Hi, >> I hale a problem with counting interwal and I can't find what to do with >> this. >> I have two fields in the table: >> Column | Type | Modifiers >> -+-+--- >> d

Re: [SQL] lost in system tables

2005-12-06 Thread Tom Lane
Emil Rachovsky <[EMAIL PROTECTED]> writes: > I am trying to find the equivalent of these two > Sybase system columns : > check_on_commit (Y/N) - Indicates whether INSERT and > UPDATE commands should wait until the next COMMIT > command to check if foreign keys are valid. I think you are lookin

Re: [SQL] Date Interval

2005-12-06 Thread Michael Fuhr
On Tue, Dec 06, 2005 at 11:54:05AM -0500, Bruce Momjian wrote: > test=> SELECT current_timestamp + cast(x || ' months' AS INTERVAL) FROM > test; >?column? > --- > 2006-03-06 11:53:05.574279-05 > (1 row) Or another way: test=> CREATE TABLE test (x numeric);

Re: [SQL] Date Interval

2005-12-06 Thread Bruce Momjian
Magdalena Komorowska wrote: > Hi, > I hale a problem with counting interwal and I can't find what to do with > this. > I have two fields in the table: > Column | Type | Modifiers > -+-+--- > date_in | date| > interwal_months | numeric | >

[SQL] Date Interval

2005-12-06 Thread Magdalena Komorowska
Hi, I hale a problem with counting interwal and I can't find what to do with this. I have two fields in the table: Column | Type | Modifiers -+-+--- date_in | date| interwal_months | numeric | -+-+--- Query

Re: [SQL] [GENERAL] lost in system tables

2005-12-06 Thread Luca Pireddu
On Tuesday 06 December 2005 08:47, Emil Rachovsky wrote: > I am trying to find the equivalent of these two > Sybase system columns : > > check_on_commit (Y/N) - Indicates whether INSERT and > UPDATE commands should wait until the next COMMIT > command to check if foreign keys are valid. A foreig

[SQL] lost in system tables

2005-12-06 Thread Emil Rachovsky
I am trying to find the equivalent of these two Sybase system columns : check_on_commit (Y/N) - Indicates whether INSERT and UPDATE commands should wait until the next COMMIT command to check if foreign keys are valid. A foreign key is valid if, for each row in the foreign table, the values in

Re: [SQL] Database with "override" tables

2005-12-06 Thread Lane Van Ingen
Not quite sure how to answer this, but one thought does occur to me: I was perhaps assuming that an override table would override an entire record in the 'original' table(that is what we are doing), and we require that critical fields in the override field be NOT NULL (and in some cases, provide DE

Re: [SQL] JOIN query not working as expected

2005-12-06 Thread Tom Lane
Mario Splivalo <[EMAIL PROTECTED]> writes: > I can create a FK on a column wich allows NULL values, and I can even > insert rows with NULLs in FK column, although PK table where FK is > pointing does not allow nuls. Is that 'by design', or...? It's per SQL spec. Add a NOT NULL constraint to the c

Re: [SQL] JOIN query not working as expected

2005-12-06 Thread Mario Splivalo
On Tue, 2005-12-06 at 09:58 -0500, Tom Lane wrote: > Mario Splivalo <[EMAIL PROTECTED]> writes: > > Now I want all services which didn't have any messages within certain > > period: > > pulitzer2=# select * from services where id not in (select distinct > > service_id from messages where receiving_

Re: [SQL] JOIN query not working as expected

2005-12-06 Thread Tom Lane
Mario Splivalo <[EMAIL PROTECTED]> writes: > Now I want all services which didn't have any messages within certain > period: > pulitzer2=# select * from services where id not in (select distinct > service_id from messages where receiving_time between '2005-10-01' and > '2005-10-30'); > (0 rows) >

Re: [SQL] Database with "override" tables

2005-12-06 Thread Michael Burke
Lane Van Ingen wrote: I think I have a similar situation involving the naming of assets, where the usual asset description is used, but users can enter a description in a separate table which 'overrides' the original name with a name that is more familiar to the individual. IF THIS IS WHAT YO

[SQL] JOIN query not working as expected

2005-12-06 Thread Mario Splivalo
How is this possible? I have two tables. 'services', and 'messages'. Each message can be assigned to one service, or it can be unnasigned. Therefore 'service_id' column in table 'messages' is not foreign-keyed to 'id' column in services table. services.id is PK for services, messages.id is PK for

[SQL] need help (not anymore)

2005-12-06 Thread Jenny
I run the VACUUM as you suggested, but still no response from the server. So, I decided to DROP the database. I got a message that the database is being used. I closed every application that accessing it. But, the message remains. I checked the server processes (ps -ax). There were lots of 'UPDAT

[SQL] need help

2005-12-06 Thread Jenny
I'm running PostgreSQL 8.0.3 on i686-pc-linux-gnu (Fedora Core 2). I've been dealing with Psql for over than 2 years now, but I've never had this case before. I have a table that has about 20 rows in it. Table "public.s_apotik" Column | Type| Modifi