Since you are selecting all the rows of media, there is no reason to use the
index to do this as it would just slow things down.
Mark
Najm Hashmi wrote:
>
> Hi all,
> I am unable to understand why my inidcies are not used in the query.
> I have following indices:
> index on categories.root
The problem is fixed in the 7.1 beta series.
Rick Delaney wrote:
>
> I'm using 7.0 and have noticed that I need to grant SELECT and UPDATE
> permissions on any referentially-related tables. Can/should I get
> around this? A somewhat contrived example:
>
> CREATE TABLE emp (
> id integer PRIM
Try
SELECT * FROM Towns WHERE id= OR id BETWEEN 3 AND 12
Antti Linno wrote:
>
> Good morning.
>
> Is there some way to make interval query?
>
> Towns table(estonia towns, heh :P)
>
> id | name
>
> 1 Elva
> 2 Tartu
> Tallinn
> 3 Tallinn/Haabersti
> 4 Tall
Tom Lane wrote:
>
> Mark Volpe <[EMAIL PROTECTED]> writes:
> > I have been using PostgreSQL-7.0.0 and have had the problem that, when
> > searching a btree index that contains large numbers of duplicate keys,
> > Postgres crashes with a BTP_CHAIN error. Now that I h
Hi,
I have been using PostgreSQL-7.0.0 and have had the problem that, when
searching a btree index that contains large numbers of duplicate keys,
Postgres crashes with a BTP_CHAIN error. Now that I have installed 7.1beta3
the problem has seemingly been fixed. Was this problem actually fixed
somewh
\N is normally used to represent NULL in a text file, however
you can change that to another string (or an empty string) using
COPY FROM ... WITH NULL AS
Mark
Sandis Jerics wrote:
>
> Hello,
>
> how must i write a NULL value in a text file for the \copy command to
> understand it?
> NULL, \0 d
You may want to think about creating your table like this (for example):
CREATE TABLE data
(
key text,
field_type char,
value text
);
CREATE UNIQUE INDEX data_key ON data(key, field_type, value);
So this way each "record" takes up several rows in the table, and each "fie
If I create a trigger that runs AFTER a DELETE, and then I delete several
rows, will the trigger function see the same thing every time it's called,
namely that all the rows I deleted are actually gone?
Mark
Hi,
I've created my own datatype for Postgres. I have found it necessary to be
able to convert it to text, so I could match it up with a text column in a
UNION. I figured Postgres would do this for me, but then, I'm naive. Can
someone give me a hint, or point me to the appropriate material on how
CREATE TABLE user_info(user_id name, entry_date date, info text);
CREATE UNIQUE INDEX user_info_key ON user_info(user_id, entry_date);
"Brian C. Doyle" wrote:
>
> Hello all,
>
> How would I prevent a user from submitting information to a table once they
> have already done so for that day. I w
> > > If is use :
> > >
> > > SELECT '0:00:00'::time + '02:10:06'::timespan;
> > >
> > > It get
> > >
> > > No such function 'time_timespan' with the specified attributes
> > >
> > &
et
>
> No such function 'time_timespan' with the specified attributes
>
> So i guess what I want to do is convert a timespan into time
> How would I do that?
>
> At 09:55 AM 8/22/00 -0400, Mark Volpe wrote:
> >I'm not sure at all what you are asking,
I'm not sure at all what you are asking, but I'm thinking you're trying to
convert a "timespan" to a "time". Try adding it to a time like this:
SELECT '0:00:00'::time + '02:10:06'::timespan;
Mark
"Brian C. Doyle" wrote:
>
> Hello all,
>
> I have a query result of @ 2 hours 10 mins 6 secs and I
It seems that why I provide a NULL argument to a PL/pgSQL function
it makes the rest of the arguments NULL, too!
Consider this function:
CREATE FUNCTION callme(text, text) RETURNS boolean AS
'
BEGIN
RAISE NOTICE ''$1: %'', $1;
RAISE NOTICE ''$2: %'', $2;
The syntax you're looking for is:
SELECT entry_id FROM tbl_date WHERE date_02 IS NULL;
Mark
Web Manager wrote:
>
> Hello,
>
> I have a problem with PostgreSQL when I try to select or delete an entry
> with an empty date. That's a typical entry
>
> Table tbl_date
> ---
Tom Lane wrote:
>
> Queries added by non-INSTEAD rules are always performed before the
> initially-given query, so you're right, the rule will see the unmodified
> value.
>
> I'd suggest folding the log-entry-making into your trigger, actually.
> If you have a trigger anyway then the insert into
The actual trigger function I'm working with is over two screens long and
rather expensive to be calling twice! Perhaps I need to add another trigger
that updates the log table with the correct values after the fact. Recursive
triggers, fun! Thanks for the help,
Mark
Ang Chin Han wrote:
>
> Eit
Hi again,
I have a table with a trigger that can potentially modify a row before it gets
inserted or updated:
CREATE TABLE t1 (a int);
CREATE FUNCTION t1_validate() RETURNS opaque AS
'
BEGIN
IF (NEW.a>10) THEN NEW.a=10; END IF;
Try creating the tables without the constraint first,
then populate them, and then add the foreign key constaint
as the last step using ALTER TABLE/ADD CONSTRAINT.
Mark
Jie Liang wrote:
>
> Hi, there,
>
> I want add a constraint to my tables:
> I have 2 tables:
> 1. Table_A(id int 4 primary k
Doesn't seem like a bad idea. I did find a better workaround, though -
cond:=TG_OP=''INSERT'';
IF cond=FALSE THEN
cond:=NEW.ip!=OLD.ip;
END IF;
IF cond=TRUE ...
so it won't kill me. Anyway, I've been totally impressed with the 7.0 release.
I'm building the EPA IP address registration sys
Hi,
I have trigger function with the statement:
IF TG_OP=''INSERT'' OR NEW.ip!=OLD.ip THEN
expecting the TG_OP=''INSERT'' to be evaluated
first, and if true, proceed with the body.
But it gets evaluated as the result of an INSERT
statement, I get a (rather strangly worded) error:
ERROR: record
Oh yeah, I'm using v7.0
Mark
Hope you like black magic :)
SELECT IND AS T1_INDEX, MIN(CASE WHEN KEY=1 THEN VALUE ELSE NULL END) AS
KEY1VAL, MIN(CASE WHEN KEY=2 THEN VALUE ELSE NULL END) AS KEY2VAL, MIN(CASE
WHEN KEY=3 THEN VALUE ELSE NULL END) AS KEY3VAL FROM T2 GROUP BY IND ORDER BY
IND;
Mark
[EMAIL PROTECTED] wrote:
>
>
23 matches
Mail list logo