Re: [GENERAL] Disabling triggers in a transaction

2005-03-09 Thread Net Virtual Mailing Lists
>Net Virtual Mailing Lists wrote: >> All I did was added an extra column to my table (I called it >> "batch_process"). Then in >> the trigger do something like (in whichever function you are calling): >> >> IF NEW.batch_update IS NOT NULL AND NEW.batch

Re: [GENERAL] Disabling triggers in a transaction

2005-03-08 Thread Net Virtual Mailing Lists
>It is the only known way to control triggers though it isn't regularly >tested by the developers. I think I've come up with another way.. I posted this recently, but did not get any feedback on it so I'm not sure how dumb it is... It is working really great for me though All I did was add

Re: [GENERAL] Inherited tables, triggers, and schemas...

2005-03-07 Thread Net Virtual Mailing Lists
a >proposal that contained a user_id contained in test.customer, but not >test2.customer? I just don't understand the documentation on this >issue of foreign keys and what is actually inherited... > >Is there someplace I can look for a more thorough explanation of how >post

[GENERAL] Inherited tables, triggers, and schemas...

2005-03-07 Thread Net Virtual Mailing Lists
Hello, I have a question about inherited tables w/r to triggers... Hopefully this will make some sense... (I'll try to keep the schema example as simple as possible): Given the follow schema/tables: -- public stuff SET search_path = public, pg_catalog; CREATE TABLE customer( customer_id SER

Re: [GENERAL] Triggers, again.. ;-)

2005-02-21 Thread Net Virtual Mailing Lists
>Greg wrote: > > is "DROP TRIGGER" transaction safe?... I mean, could I do: > > > > BEGIN > > DROP TRIGGER category_mv_ut; > > ... insert rows > > ... update materialized view table > > CREATE TRIGGER category_mv_ut AFTER UPDATE ON items > > FOR EACH ROW EXECUTE PROCEDURE update_ut(); > > COMMIT;

[GENERAL] Triggers, again.. ;-)

2005-02-19 Thread Net Virtual Mailing Lists
Hello, I have asked about this before, but I just haven't been able to get anywhere with it yet.. I'm hoping someone can help me? Here is my original function and trigger: CREATE OR REPLACE VIEW items_category AS select count(*) AS count ,b.category,nlevel(b.category) AS level, subpath(b.cate

[GENERAL] ltree valid characters

2005-01-06 Thread Net Virtual Mailing Lists
Hello, I'm using ltree but I have a requirement to use the "-" character in the text of a node. Can I just change (in ltree.h) the following line: #define ISALNUM(x) ( isalnum((unsigned char)(x)) || (x) == '_') to: #define ISALNUM(x) ( isalnum((unsigned char)(x)) || (x) == '_' || (x)

[GENERAL] tsearch2 avoiding firing of triggers.....

2004-12-16 Thread Net Virtual Mailing Lists
For some reason, I feel as though I have asked this before but I can't find it anywhere. I hope it is not repetitive! I have various triggers and rules in my database, mostly for keeping tsearch2 updated and (now) materialized views. I'd say probably 90% of the updates to my database do not

Re: [GENERAL] 3rd RFD: comp.databases.postgresql (was:

2004-12-03 Thread Net Virtual Mailing Lists
My only suggestion: I don't care what you do with the newsgroups, just don't screw with the mailing lists. If the mailing lists go away, I will be *EXTREMELY* disappointed! - Greg >Hopefully someone like Russ will tell us the correct term for domains like >microsoft.* and gnu.

Re: [GENERAL] [ANNOUNCE] USENET vs Mailing Lists Poll ...

2004-11-30 Thread Net Virtual Mailing Lists
For what its worth, I vote no. I like the mailing lists. If having a newsgroup is beneficial, I say go ahead and start one, but don't mess around with the mailing lists, please. I really like the one or two digests I get in my mailbox everyday. - Greg ---(e

Re: [GENERAL] Why the current setup of pgsql.* and

2004-11-28 Thread Net Virtual Mailing Lists
n saying - Greg >Now that Marc has created his own dedicated hierarchy, and all 29 lists are >gated to individual groups..picked up by Supernews and soon-to-be >Stanford..the best thing for the proponent to do from now on is to go back >to the single group for PostgreSQL..named co

[GENERAL] why use SCHEMA? any real-world examples?

2004-11-25 Thread Net Virtual Mailing Lists
I am in the middle of a project to convert non-schema databases to a schema-based system. The main reason I am doing it is because I need to do a join on tables between databases, which can only be done with an contrib module which does not have all the "features" one might want (such as use of in

Re: [GENERAL] pgdump of schema...

2004-11-24 Thread Net Virtual Mailing Lists
Actually this database has been carried forward since the "postgres95" days, so you are definitely right in your analysis.. Would another (perhaps safer?) way of doing this is to remove the "CREATE SEQUENCE" and "SELECT pg_catalog.setval", and replace the "DEFAULT nextval" with "SERIAL" then rest

Re: [GENERAL] Creating index on a view?

2004-11-24 Thread Net Virtual Mailing Lists
y disk usage. I hope this clarifies... I think I'm confused just trying to explain it! - Greg >Net Virtual Mailing Lists wrote: >> My question is regarding creating an index on a view, or perhaps >> another way to accomplish this. > >Views are just macro expansions of quer

[GENERAL] Creating index on a view?

2004-11-24 Thread Net Virtual Mailing Lists
Hello, First, let me apologize for my flurry of emails as of late... I'm working on something which seems particularly difficult (at least to me)... My question is regarding creating an index on a view, or perhaps another way to accomplish this. For example: CREATE TABLE table1 ( table1_id S

[GENERAL] pgdump of schema...

2004-11-23 Thread Net Virtual Mailing Lists
Hello, When I do a "pgdump --schema=someschema somedatabase > something.dump", the results of the dump file look like this: REVOKE ALL ON SCHEMA someschema FROM PUBLIC; GRANT ALL ON SCHEMA someschema TO PUBLIC; SET search_path = someschema, pg_catalog; CREATE SEQUENCE emailtemplate_email_t

Re: [GENERAL] Lexical question...

2004-11-23 Thread Net Virtual Mailing Lists
Err, I just read my latest digest and saw the solution: update datafrenzy.jobdata set entered_dt= now() - CAST(round(random()*45) || ' days' AS interval); - Greg >Hello, > >I have a table with a timestamp column and I want to set this to a value >of now() - a random number of days between 0 and

Re: [GENERAL] null value of type java.sql.Time

2004-11-23 Thread Net Virtual Mailing Lists
Try: select * from event where game_clock IS NULL - Greg >Occasionally I want to store a null value for my java.sql.Time--> Time >column in Postgresql. >update event set game_clock=null where event_id=1; > > I can retreive the record with the null value (type Time) if I select >on the primary

[GENERAL] Lexical question...

2004-11-23 Thread Net Virtual Mailing Lists
Hello, I have a table with a timestamp column and I want to set this to a value of now() - a random number of days between 0 and 45 for each row... I've tried to do this a bunch of different ways and can't figure it out... Here is my latest version: update sometable set entered_dt = now() - inte

[GENERAL] Unions, schemas, and design questions...

2004-11-21 Thread Net Virtual Mailing Lists
I've been spending the last few days converting many databases into a single schema and have completed the process, but now I'm at somewhat of an impasse as to the best way to proceed forward It is important for me to explain that each of these databases has a rather different structure, going

Re: [GENERAL] Join between databases or (???)

2004-11-21 Thread Net Virtual Mailing Lists
See comments below.. >On Sun, Nov 21, 2004 at 12:27:11AM -0700, Net Virtual Mailing Lists wrote: > >> I am having one problem I just can't figure out In my dump file I >> have something like: >> CREATE SEQUENCE testschema.industries_industry_id_seq >>

Re: [GENERAL] Join between databases or (???)

2004-11-21 Thread Net Virtual Mailing Lists
stries it complains about testschema.industries_industry_id_seq not existing, yet I can execute "nextval" against that very schema Any idea what might be going wrong here?... Thanks! - Greg >On Sat, Nov 20, 2004 at 07:37:12PM -0700, Net Virtual Mailing Lists wrote: > >> If I w

Re: [GENERAL] Join between databases or (???)

2004-11-20 Thread Net Virtual Mailing Lists
>On Sat, Nov 20, 2004 at 06:09:49PM -0700, Net Virtual Mailing Lists wrote: > >> I have situation where multiple databases need to use data from a common >> source and it would consume way too much disk space to reproduce this >> data into the many databases which require it.

[GENERAL] Join between databases or (???)

2004-11-20 Thread Net Virtual Mailing Lists
Hello, I have situation where multiple databases need to use data from a common source and it would consume way too much disk space to reproduce this data into the many databases which require it. Is there some way to do a join between databases or some other way of making the data in one databas

Re: [GENERAL] Important Info on comp.databases.postgresql.general

2004-11-11 Thread Net Virtual Mailing Lists
ement to make the list official. > >The extra traffic I believe is coming from the discussion of the >USENET people trying to get this done. Most USENET folk are good >manor people just like you find on the lists. > >There are a lot of politics involved in USENET that are not pre

Re: [GENERAL] Important Info on comp.databases.postgresql.general

2004-11-10 Thread Net Virtual Mailing Lists
Yeah.. I'm with you.. I don't really know what all of this is about - I like the way the Postgres mailing list works as it is Are any of the changes being discussed here going to change the content or how we receive the mailing lists?.. .. The only change I've noticed is that

Re: [GENERAL] [pgsql-general] Daily digest v1.4794 (21 messages)

2004-11-10 Thread Net Virtual Mailing Lists
Yeah.. I'm with you.. I don't really know what all of this is about - I like the way the Postgres mailing list works as it is Are any of the changes being discussed here going to change the content or how we receive the mailing lists?.. What exactly is the problem they thing exis

Re: [GENERAL] Can this be indexed?

2004-11-08 Thread Net Virtual Mailing Lists
ml > >> -Ursprüngliche Nachricht- >> Von: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] Im Auftrag von >> Net Virtual Mailing Lists >> Gesendet: Samstag, 6. November 2004 16:49 >> An: Matteo Beccati >> Betreff: Re: [GENERAL] Can this be indexed? >

[GENERAL] Sorting based on maximum value over several columns

2004-11-06 Thread Net Virtual Mailing Lists
Hello, Lets say I have data like this: value1|value2|value3|value4||value(N) --|--|--|--|| 100 | 200 | 300 | 400 || 10| 20 | | 40 || | 15 | | 16 || 5 | | | || Now I want to sort these based on t

[GENERAL] Temporarily disable rule, is this possible?

2004-11-06 Thread Net Virtual Mailing Lists
Hello, I have a table with a rule that goes something like this: CREATE OR REPLACE RULE sometable_delete ON DELETE DO delete FROM cache WHERE tablename='sometable'; CREATE OR REPLACE RULE sometable_insert ON INSERT DO delete FROM cache WHERE tablename='sometable'; CREATE OR REPLACE RULE sometable

Re: [GENERAL] Can this be indexed?

2004-11-06 Thread Net Virtual Mailing Lists
I am not clear how to use a trigger for this, I will need to look into that It is my understanding that Postgres does not have materialized views though (which I believe would solve this problem nicely) - am I mistaken?... - Greg >Net Virtual Mailing Lists wrote: >> Is there

[GENERAL] Can this be indexed?

2004-11-06 Thread Net Virtual Mailing Lists
Is there a way to create an index that would make this query be efficient and not perform a sequential scan? SELECT count(*) AS count,id FROM sometable GROUP BY id; .. I've considered creating a rule on this table which would put the results of this into another table anytime it is updated, but I

Re: [GENERAL] [DEFAULT] Daily digest v1.4774 (21 messages)

2004-11-01 Thread Net Virtual Mailing Lists
ads" debate. > >-Neil ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [GENERAL] Question about ltree....

2004-10-26 Thread Net Virtual Mailing Lists
Somehow I missed the ltree[] array stuff - this solves fairly nicely at least the second part of my problem, but I'm still not sure how to optimize the query which contains the union... My optimized table looks like this: CREATE TABLE sometable ( id SERIAL, category LTREE[] );

[GENERAL] Sorting, when values are equal....

2004-10-25 Thread Net Virtual Mailing Lists
Hello, If I do something like: SELECT * FROM sometable ORDER BY somerow DESC LIMIT 1 OFFSET 2; .. and there are multiple rows in sometable where somerow is identical, am I assured that the values will always come back in the same order? . Or do I need to ensure that a second sort (such as

Re: [GENERAL] Tsearch2 trigger firing...

2004-10-16 Thread Net Virtual Mailing Lists
Hello, Thank you to Oleg for your help with this earlier! It resolved it very nicely! I still have one remaining issue which I can't figure out, perhaps best explained with an example: CREATE TABLE sometable ( titleTEXT, body TEXT, footer TEXT, all_fti TSVECTOR ); UPDATE sometable

[GENERAL] Tsearch2 trigger firing...

2004-10-15 Thread Net Virtual Mailing Lists
Hello, I have a table that uses tsearch2 and, of course, and index and trigger to keep everything updated. Something like: CREATE TABLE sometable ( id SERIAL, someinteger INTEGER sometext TEXT, sometext2TEXT, sometext3TEXT, sometext_fti TSVECTOR

[GENERAL] Rules and locking within a transaction?...

2004-10-09 Thread Net Virtual Mailing Lists
Hello, If I have a rule like this: CREATE OR REPLACE RULE sometable_update AS ON UPDATE TO table2 DO UPDATE cache SET updated_dt=NULL WHERE tablename='sometable'; CREATE OR REPLACE RULE sometable_insert AS ON INSERT TO table2 DO UPDATE cache SET updated_dt=NULL WHERE tablename='sometable'; CREAT

Re: [GENERAL] Index problem.... GIST (tsearch2)

2004-10-07 Thread Net Virtual Mailing Lists
Thanks, you are right, I mis-typed the statements (lack of sleep *shrug*), thanks for parsing through it... Your suggestion did resolve the situation nicely! - Greg >"Net Virtual Mailing Lists" <[EMAIL PROTECTED]> writes: >> I have a table like this with some indexes a

Re: [GENERAL] Index problem.... GIST (tsearch2)

2004-10-07 Thread Net Virtual Mailing Lists
T * from sometable WHERE category1 IS NOT NULL > AND data_fti @@ to_tsquery('default', 'postgres'); > >Why bother to write a function when what you want is supported right in SQL? >Avoids a function call. You might want to think about exactly what you wa

[GENERAL] Index problem.... GIST (tsearch2)

2004-10-07 Thread Net Virtual Mailing Lists
Hello, I have a table like this with some indexes as identified: CREATE TABLE sometable ( dataTEXT, data_ftiTSVECTOR, category1 INTEGER, category2 INTEGER, category3 INTEGER ); CREATE OR REPLACE FUNCTION is_null(anyelement) RETURNS BOOLEAN AS 'SELECT $1 IS

[GENERAL] Query problem...

2004-10-02 Thread Net Virtual Mailing Lists
Hello, I have 3 tables which are joined that I need to create a summation for and I just cannot get this to work. Here's an example: CREATE table1 ( id1INTEGER, title1 VARCHAR ); INSERT INTO table1 (1, 'Heading #1'); INSERT INTO table1 (2, 'Heading #2'); CREATE table2 ( id1I

Re: [GENERAL] Postgres inherited table, some questions...

2004-09-29 Thread Net Virtual Mailing Lists
Hello, I hate to re-ask this again (sorry to be repetitive!)... I really could use some help with this, if anyone is familiar with table inheritance as it applies to my questions Thanks! - Greg >Hello, > >I am playing with the "INHERITS" functionality of create table to >determine its suita

Re: [GENERAL] Dropping schemas and "illegal seek" -- MEA CUPLA

2004-06-07 Thread felix-lists
>>In article <[EMAIL PROTECTED]>, Felix Finch <[EMAIL PROTECTED]> writes: > I have a perl test program ... and began getting this complaint > from psql: > Can't drop schemas: Illegal seek Ahhh yesss... otherwise known as the subroutine not returning any specific value and the caller expecti

Re: [GENERAL] Join query on 1M row table slow

2004-02-10 Thread lists
On Tue, 10 Feb 2004, CSN wrote: > I have a pretty simple select query that joins a table > (p) with 125K rows with another table (pc) with almost > one million rows: > > select p.* > from product_categories pc > inner join products p > on pc.product_id = p.id > where pc.category_id = $category_id

[GENERAL] tsearch2 question...

2003-10-19 Thread Net Virtual Mailing Lists
Hello, I have a quick question regarding tsearch2, hopefully this is an okay place to ask because I couldn't find a tsearch2-specific mailing list.. Anyways, when the field which is indexed using tsearch2 is displayed in it's entirety I want the searched keywords to be highlighted, just as in a h

[GENERAL] no port support in pg_ctl?

2001-01-25 Thread Mailing Lists for Postgres
To answer the question "why?".. I'm wanting to run multiple independent database sessions of Postgresql on the same machine. I thought I'd just copy pgsql.sh startup scripts and add the -D option to specifiy different database locations and -p option to specify different tcp port numbers. Howeve

Re: [GENERAL] Date arithmatic question

2000-11-17 Thread Bryan \(Mailing Lists\)
Whoops, I had a typo in my translation; the second query I quoted should read as follows: select * from t where date_part('day', age('now', s)) = ? and date_part('month', age('now', s)) = 0 Thanks, Bryan - Original Message - From: "

[GENERAL] Date arithmatic question

2000-11-17 Thread Bryan \(Mailing Lists\)
I have a table "t" with a timestamp column "s". I am trying to issue a query to find all rows where s is exactly some number of days old (rounded off). I have tried this: select * from t where date_part('day', age('now', s)) = ? But this only looks at the day of the month; e.g. if my parameter

<    1   2