RE: [GENERAL] How do system tables relate to other tables in postgresql

2001-07-11 Thread tamsin
think this should do it: select attname from pg_attribute where attnotnull = 't' and attrelid = (select oid from pg_class where relname = 'tablename'); regards, tamsin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Graeme Longma

RE: [GENERAL] Re: Adding a NOT NULL column?

2001-06-28 Thread tamsin
i've always had to add the column first and then do: update pg_attribute set attnotnull = 't' where attname = 'fieldname' and attrelid = (select oid from pg_class where relname = 'tablename'); but i'm using version 7.0.2, maybe the alter column to set n

RE: [GENERAL] newbie:how can i get day of week data type...

2001-06-14 Thread Tamsin
use the date_part function: test=# select date_part('dow',current_timestamp); date_part --- 4 (1 row) or: select date_part('dow',day) from schedule; where 'dow' is the day of week. see the user docs for other date/time functions hth t

RE: [GENERAL] Large OR query

2001-06-12 Thread Tamsin
o: SELECT maintable.* FROM maintable, temptable WHERE maintable.id = temptable.id; tamsin > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Mitch Vincent > Sent: 12 June 2001 15:25 > To: Zak McGregor; [EMAIL PROTECTED] > Subject: Re: [GENE

RE: [GENERAL] CREATE TABLE AS... syntax?

2001-04-26 Thread Tamsin
i think its: CREATE TABLE foo AS SELECT number FROM account; tamsin > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Dr. Evil > Sent: 25 April 2001 23:46 > To: [EMAIL PROTECTED] > Subject: [GENERAL] CREATE TABLE AS... syntax? >

RE: [GENERAL] cant delete row

2001-04-05 Thread Tamsin
doh! now i feel _really_ stupid! of course, I managed to forget all about the rule i made which inserts into another table when a row is deleted. altered that table & recreated the rule, and all is fine. thanks tom! tamsin > -Original Message- > From: [EMAIL PROTECTED] > [

RE: [GENERAL] Alter column length

2001-03-23 Thread Tamsin
I've used that method without any problems. I had to experiment a bit by creating test tables with different length columns to see what to set atttypmod to, because I didn't really know what the value meant! Seemed to work ok though... Tamsin > > --

[GENERAL] non-existent user "28"

2001-03-22 Thread Tamsin
nd I've checked pg_shadow, and there is no user 28. I'm not sure how the database got in this state - would this happen when I drop & recreate a user? Is there something I can do about this? I couldn't see where in the system tables the permission info is stored. Thanks, Tamsi

[GENERAL] drop check constraint

2001-02-07 Thread Tamsin
nt command. Is there something I can do to the system tables? (PostgreSQL 7.0.2) Thanks for any ideas, Tamsin

[GENERAL]

2001-02-01 Thread Tamsin
he size of a numeric field, e.g. from numeric(8,2) to numeric(10,2). I can't really see how the data in pg_attribute for this field relates to the field size. Does anyone know if this is possible & if so how? Thanks very much, Tamsin (PostgreSQL 7.0.2)

[GENERAL] union query

2001-01-12 Thread Tamsin
n Each UNION | EXCEPT | INTERSECT clause must have compatible target types Its not a problem, as I now I've worked it out I can do what I wanted (a long nasty union to get around some outer join issues), but I just wondered if the order of the selects in a union should matter? tamsin

RE: [GENERAL] How to see a RULE definition?

2001-01-11 Thread Tamsin
try this: select * from pg_rules where tablename = ... tamsin > On that > same line of thinking, is there a command to get a list of > all rules that > have been put on a table?

RE: [GENERAL] Modify Column

2000-12-01 Thread Tamsin
This worked for me: update pg_attribute set atttypmod = 104 where attname = 'column_name' and attrelid = (select oid from pg_class where relname = 'tablename'); to set a varchar column 'columnname' in 'tablename' to a size of 100. Tamsin > -Ori

RE: [GENERAL] permissions & foreign keys

2000-09-04 Thread Tamsin
That's cleared that up, thanks! Tamsin -Original Message- From: Jan Wieck [mailto:[EMAIL PROTECTED]] Sent: 04 September 2000 15:50 To: Tamsin Cc: [EMAIL PROTECTED] Subject: Re: [GENERAL] permissions & foreign keys Tamsin wrote: > > I don't really see wh

[GENERAL] permissions & foreign keys

2000-09-04 Thread Tamsin
REFERENCES feedback_type; I don't really see why it wants to update feedback_type? Can anyone tell me what I'm doing wrong, or will I just have to grant update on feedback_type (and all other tables referenced by FKs)? Thanks for any help, Tamsin -