Re: [SQL] Find periods for a given... action set?

2009-06-23 Thread James Kitambara
Hello Mario Splivalo, I found some solution to your question but it is not exact one.   ** SELECT a.user_id, a.action_time- (select a2.action_time from actions a2 where a2.user_id =     (select a3.user_id from

[SQL] Composite primary keys

2009-06-23 Thread Harald Fuchs
I tried to throw some invalid SQL to PostgreSQL and found its reaction confusing: $ psql test psql (8.4beta2) Type help for help. test=# CREATE TABLE t1 ( test(# id serial NOT NULL, test(# name text NOT NULL, test(# PRIMARY KEY (id) test(# ); CREATE TABLE

Re: [SQL] Composite primary keys

2009-06-23 Thread Tom Lane
Harald Fuchs hari.fu...@gmail.com writes: I tried to throw some invalid SQL to PostgreSQL and found its reaction confusing: test(# language char(3) NULL, This is documented as being a no-op specification. regards, tom lane -- Sent via pgsql-sql mailing list

Re: [SQL] Composite primary keys

2009-06-23 Thread Oliveiros Cristina
Howdy! When you say that pg accepts this silently instead of complaining what are you referring to exactly? First Insert? Why wouldn't it work after all ? What will happen is that when you try to insert a new record without specifying the id column you'll get an error informing that primary

Re: [SQL] Composite primary keys

2009-06-23 Thread Joshua Tolley
On Tue, Jun 23, 2009 at 05:14:36PM +0200, Harald Fuchs wrote: test=# CREATE TABLE t2 ( test(# id int NOT NULL REFERENCES t1, test(# language char(3) NULL, test(# txt text NOT NULL, test(# PRIMARY KEY (id, language) test(# ); CREATE TABLE snip test=# INSERT INTO t2

Re: [SQL] Composite primary keys

2009-06-23 Thread Tom Lane
Joshua Tolley eggyk...@gmail.com writes: Primary keys are NOT NULL and UNIQUE. You can't have null values in a primary key. On reflection I think the OP's beef is that we complain about this: regression=# create table t (f1 int null not null); ERROR: conflicting NULL/NOT NULL declarations for

[SQL] Client-side compression

2009-06-23 Thread Rob Sargent
Not sure if this belongs here or on the admin or performance list. Apologies if so. (And this may be a second posting as the first was from an un-registered account. Further apologies) My assumption is that any de/compression done by postgres would be server-side. We're considering