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
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
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
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
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?
>
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]
> [
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
>
> --
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
nt command. Is
there something I can do to the system tables?
(PostgreSQL 7.0.2)
Thanks for any ideas,
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)
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
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?
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
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
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
-
15 matches
Mail list logo