Re: [SQL] Proposed archival read only trigger on rows - prevent history modification

2008-02-21 Thread Robert Treat
ves (on update do nothing) which tends to work pretty well. You can also add triggers into the mix to raise errors on update. Also dont forget to revoke update/delete/install privileges as appropriate. And look into vacuum freeze. -- Robert Treat Build A Brighter LAMP :: Linu

Re: [SQL] [GENERAL] Any documatation about porting from Oracle to PostgreSQL

2006-10-18 Thread Robert Treat
) Felix, in case your still watching, a (in theory) more up to date link would be found at http://www.postgresql.org/docs/techdocs.3. Oh, and please don't crosspost across 3 different lists in the future, it just creates noise for the rest of us. -- Robert Treat Build A Brighter LAMP ::

Re: [SQL] in PlPgSQL function, how to use variable in a "select ...

2006-03-17 Thread Robert Treat
guage 'plpgsql' IMMUTABLE STRICT; > select test('001'); > This function would work on 8.1, provided you created the sql statement correctly: query_value := 'SELECT col2 FROM ' ||lengendTableName||' WHERE col1 = \'' || col1_value || '\'';

Re: [SQL] Postgres 7.3 migrate to 8.0 date problems.

2005-03-30 Thread Robert Treat
mbers are both <=12, then you'll get one > "date" and if the wrong one is >12 you'll get another. That can't be > good. > Would it be possible to use a BEFORE trigger to reformat the -DD-MM date to -MM-DD ? The error I see on 7.4 is ERROR:

[SQL] save me from an unconstrained join

2005-03-30 Thread Robert Treat
ach software is assigned a "class" based on the size of its binary into a predetermined range of classes that are defined as relative filesizes. The above query really does work... but istm I ought to be joining those tables somehow... any ideas? Robert Treat -- Build A Brighter Lamp ::

Re: [SQL] diff databases

2004-12-28 Thread Robert Treat
ee thier website for details. -- Robert Treat Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] partial unique constraint

2004-04-06 Thread Robert Treat
On Tue, 2004-04-06 at 11:17, Tom Lane wrote: > Robert Treat <[EMAIL PROTECTED]> writes: > > Trying to come up with the proper syntax to meet the following criteria: > > create table foo (bar integer, baz boolean UNIQUE (bar, baz = true)); > > The correct way to do i

[SQL] partial unique constraint

2004-04-06 Thread Robert Treat
n external trigger, but am wondering about a constraint oriented approach Robert Treat -- Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] designer tool connect to PostgreSQL

2004-03-10 Thread Robert Treat
take a look at http://techdocs.postgresql.org/guides/GUITools Robert Treat On Tue, 2004-03-09 at 02:53, BenLaKnet wrote: > > Rekall ... > http://www.totalrekall.co.uk/ <http://www.totalrekall.co.uk/> > (commercial website) > http://www.reka

Re: [PERFORM] [HACKERS] [SQL] Materialized View Summary

2004-02-25 Thread Robert Treat
On Wed, 2004-02-25 at 03:19, Jonathan M. Gardner wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > I'm not sure if my original reply made it through. Ignore the last one if > it did. But I liked the last one :-) > > On Tuesday 24 February 2004 1:48 pm,

Re: [HACKERS] [SQL] Materialized View Summary

2004-02-24 Thread Robert Treat
to > from techdocs. Done. :-) > > If you could identify candidate keys on a view, you could conceivably automate > the process even more. That's got to be possible in some cases, but I'm not > sure how difficult it is to do in all cases. > it seems somewhere be

Re: [SQL] umlimited arguments on function

2004-02-15 Thread Robert Treat
d method in 7.3 where its much more challenging.) HTH, Robert Treat -- Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining

Re: [SQL] Help converting Oracle instead of triggers to PostgreSQL

2003-12-13 Thread Robert Treat
Just to follow up I managed to track down these missing articles and have updated the links on the website. Robert Treat On Thursday 04 December 2003 12:52, Clint Stotesbery wrote: > Hi Christoph, > Thanks for the links but the techdoc links for converting from Oracle to > Postgre

Re: [SQL] Help converting Oracle instead of triggers to PostgreSQL

2003-12-06 Thread Robert Treat
Generally speaking you can send articles to me or to [EMAIL PROTECTED] for inclusion on the techdocs site. I'll try to update the links you mentioned below as well. thanks. Robert Treat On Thursday 04 December 2003 12:52, Clint Stotesbery wrote: > Hi Christoph, > Thanks for the li

Re: [SQL] createlang plpgsql failing on redhatlinux7.2

2003-09-13 Thread Robert Treat
On Friday 12 September 2003 12:18, Richard Huxton wrote: > On Friday 12 September 2003 16:49, Robert Treat wrote: > > rather do an rpm -qa | grep post to see if postgresql-pl-7.3.4-2PGDG is > > installed, it is the rpm for procedural languages in 7.3.* and didn't > >

Re: [SQL] createlang plpgsql failing on redhatlinux7.2

2003-09-12 Thread Robert Treat
rather do an rpm -qa | grep post to see if postgresql-pl-7.3.4-2PGDG is installed, it is the rpm for procedural languages in 7.3.* and didn't exist in the 7.2.* rpmset. Robert Treat On Fri, 2003-09-12 at 10:12, Richard Huxton wrote: > Please don't post html-only messages to the l

Re: [SQL] [GENERAL] Postgresql slow on XEON 2.4ghz/1gb ram

2003-08-08 Thread Robert Treat
If you went from a dual processor box running windows to a single processor box running windows, I wouldn't be surprised to see a slow down. I'd recommend switching from Windows to Linux/BSD over a hardware upgrade any day. Robert Treat On Wed, 2003-08-06 at 18:04, Maksim Likharev wro

Re: TODO item for plpgsql Was Re: [SQL] obtuse plpgsql function needs

2003-08-01 Thread Robert Treat
I don't seem to have any plsql specfic documentation, and the rest of my oracle documentation isn't specfific enough. Anyone else? Robert Treat On Thursday 31 July 2003 00:12, Bruce Momjian wrote: > Does Oracle have a sy

Re: TODO item for plpgsql Was Re: [SQL] obtuse plpgsql function needs

2003-07-23 Thread Robert Treat
On Wednesday 23 July 2003 19:06, Bruce Momjian wrote: > Robert Treat wrote: > > On Wed, 2003-07-23 at 15:38, [EMAIL PROTECTED] wrote: > > > FOR myrec IN EXECUTE myinfo LOOP > > > biglist := myrec.info; > > > END LOOP; > > > > One other thing

TODO item for plpgsql Was Re: [SQL] obtuse plpgsql function needs

2003-07-23 Thread Robert Treat
On Wed, 2003-07-23 at 15:38, [EMAIL PROTECTED] wrote: > FOR myrec IN EXECUTE myinfo LOOP > biglist := myrec.info; > END LOOP; > One other thing, I hate when I have to do things like the above, can we get a TODO like: allow 'EXECUTE var INTO record' in plpgsql Ro

Re: [SQL] obtuse plpgsql function needs

2003-07-23 Thread Robert Treat
talog lookups, but is pltcl inherently faster anyways? thanks for the input so far. Robert Treat On Wed, 2003-07-23 at 15:38, [EMAIL PROTECTED] wrote: > SELECT a,b,c,msgmaker('t1',ctid) FROM t1 WHERE a=b; > > > CREATE OR REPLACE FUNCTION msgmaker(text,tid) RET

Re: [SQL] time delay function

2003-07-23 Thread Robert Treat
(1 row) wait -- t (1 row) now --- 2003-07-23 15:45:51.758621-04 (1 row) 21343=# 21343=# select now(); select wait(10); select now(); now --- 2003-07-23 15:45:58.713646-04 (1 row) wait -- t (1 row)

Re: [SQL] obtuse plpgsql function needs

2003-07-23 Thread Robert Treat
On Wed, 2003-07-23 at 09:06, Robert Treat wrote: > On Tue, 2003-07-22 at 19:33, elein wrote: > > You'll need to pass the values down to your > > concat function (which I suggest you don't call concat) > > and have it return a text type. > > > > What

Re: [SQL] obtuse plpgsql function needs

2003-07-23 Thread Robert Treat
at I need the function to be generic so that I don't have to pass the values down to the function, it just grabs the values automagically based on the table it's being called against. Robert Treat > elein > > On Tue, Jul 22, 2003 at 06:31:52PM -0400, Robert Treat wrote:

[SQL] obtuse plpgsql function needs

2003-07-22 Thread Robert Treat
; || f3) as x from t1; or select f,concat() as info from t2; returns equivalent select f,('f4:' || f4 || ' - f5:' || f5 || ' - f6:' || f6) as x from t2; I'm starting to believe this is not possible, has anyone already done it? :-) Robert T

Re: [SQL] Immutable attributes?

2003-07-01 Thread Robert Treat
27;s "better", but this is one of the things people find the RULE system really handy for. Check the docs, I believe there are examples of this. Robert Treat -- Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] help with "delete joins"

2003-07-01 Thread Robert Treat
CT bar.a FROM bar > WHERE bar.a = foo.a AND bar.b = foo.b > AND bar.c = foo.c ); I was almost there with my original query... a NOT on your/stephan's query gets me what I really want. :-) Thanks guys. Robert Treat -- Build A Brighter Lamp :: Linux Apache {

Re: [SQL] help with "delete joins"

2003-06-30 Thread Robert Treat
On Mon, 2003-06-30 at 18:26, Robert Treat wrote: > create table foo (a int, b int, c int, d text); > > create table bar (a int, b int, c int); > > insert into foo values (1,2,3,'a'); > insert into foo values (1,2,4,'A'); > insert into foo values (4,5,6

[SQL] help with "delete joins"

2003-06-30 Thread Robert Treat
+---+---+--- 1 | 2 | 4 | A 4 | 5 | 6 | b (2 rows) but thats not valid sql, is there some way to accomplish this? Robert Treat ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [SQL] control structures in plpgsql

2003-06-12 Thread Robert Treat
On Thu, 2003-06-12 at 10:24, Stephan Szabo wrote: > > On 12 Jun 2003, Robert Treat wrote: > > > Does anyone know if there is support for "IF x OR y THEN" syntax in > > plpgsql? The docs just say IF [boolean expression] then. which loosely > > interpreted

[SQL] control structures in plpgsql

2003-06-12 Thread Robert Treat
Does anyone know if there is support for "IF x OR y THEN" syntax in plpgsql? The docs just say IF [boolean expression] then. which loosely interpreted could allow for an OR, but I couldn't seem to get it to work. TIA, Robert Treat -- Build A Brighter Lamp :: Linux Apache {middlew

Re: [SQL] [ADMIN] Perl Book

2003-05-29 Thread Robert Treat
is, but oreilly has a number of bio-informatics books, several of which deal specifically with perl. Robert Treat ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] How to increase Column width of table

2003-03-25 Thread Robert Treat
http://fts.postgresql.org/db/mw/msg.html?mid=1071582 On Tue, 2003-03-25 at 10:18, Christoph Haller wrote: > > > > Atul here, i have one table and i would like to increase the length > of > > existing column and the sql statement is > > > >Exisiting Column is "vehicle_make" varchar(30)

Re: [SQL] postmaster -i & establishes three connections why?

2003-02-14 Thread Robert Treat
22922504 1960 con 500 17:43:36 /usr/bin > Are you sure those are connections. On server start you should get three process going, the main postmaster, the stats collector, and the stats buffer Robert Treat ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] SQL function parse error ?

2003-01-10 Thread Robert Treat
claim that a certain feature needs to work in a different fashion, or needs to be added at the expense of another feature, that it is only natural and a good thing that the proposal be given a little scrutiny to make sure it stands up. At this point yours does so in my book, though I still woul

Re: [SQL] SQL function parse error ?

2003-01-09 Thread Robert Treat
ample put forth. The problem is that foo>$1 doesn't work, which by comparison would be SELECT* which would also not work. Robert Treat ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

Re: [SQL] Postgresql Bug List?

2003-01-09 Thread Robert Treat
One could subscribe to pgsql-bugs if you wanted to look into any new bugs that come down the pipe. Robert Treat On Wed, 2003-01-08 at 23:30, Bruce Momjian wrote: > > No bugzilla, but do have a TODO list. See the develope

Re: [SQL] Sorry, to many clients already

2003-01-06 Thread Robert Treat
ons that are allowed. This might be an indication of other problems, but if you simply want to raise the limit you'll need to modify max_connections in the postgresql.conf Robert Treat ---(end of broadcast)--- TIP 2: you can get off all lists a

Re: [SQL] unsubscribe

2002-12-19 Thread Robert Treat
If you just want to take a break, your better off sending "set ALL nomail-14d" to majordomo. Robert Treat On Thu, 2002-12-19 at 07:39, Christoph Haller wrote: > > David and all others on the list, > who want to turn off mailing over xmas and new year, > please se

[SQL] working around setQuerySnapshot limitations in functions

2002-12-16 Thread Robert Treat
Does anyone see another work-around? Robert Treat ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [SQL] Ran out of connections

2002-12-04 Thread Robert Treat
Once your done scoping other things out, you might also want to look at increasing the number of allowed connections (in postgresql.conf). The defaults can be low for high traffic systems. Robert Treat On Wed, 2002-12-04 at 17:29, Steve Crawford wrote: > You probably didn't need to re

Re: [SQL] celko nested set functions -- tree move

2002-11-26 Thread Robert Treat
o=t_newparent INTO newparentrgt, newparentuid, newparenttid; I think it's more readable and probably a little more efficient since you are doing less variable assignment. Robert Treat On Tue, 2002-11-26 at 00:13, Martin Crundall wrote: > I'm not sure that keying off lft is safe

Re: [SQL] RE: [SQL] System´s database table

2002-11-14 Thread Robert Treat
There's no sense waiting as 7.3 is about to go RC1, and only the most improbable circumstances would lead to a system catalog change at this point. (If you do make a diagram, please post it to the group ) Robert Treat On Wed, 2002-11-13 at 16:28, Jean-Luc Lachance wrote: > Thanks, I kn

Re: [SQL] Permission on insert rules

2002-11-12 Thread Robert Treat
om parent; select * from child; insert into child (4,'four'); select * from parent; create user mellymel; grant select on child to mellymel; grant insert on child to mellymel; ** reconnect as mellymel ** select * from parent; (generates error) select * from child; insert into child

Re: [SQL] Permission on insert rules

2002-11-11 Thread Robert Treat
o do updateable rules and give only permissions to the view for the caller. (Though maybe you have to use triggers rather than rules to do this?) Does that sound right? Robert Treat ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

Re: [SQL] changing numeric into int

2002-11-08 Thread Robert Treat
add a rule to always set the old columns to NULL. Robert Treat On Fri, 2002-11-08 at 02:41, Huub wrote: > Hi, > > I want to change 2 columns in the same table from numeric into int. Can > I do this without deleting the old table and creating a new one? Data > stays the sam

Re: [GENERAL] [SQL] Database Design tool

2002-11-05 Thread Robert Treat
. Instead I decided to use Case Studio 2.x, which is a pretty good replacement imo. (For the record though, it is neither free nor does it run on linux). Robert Treat On Tue, 2002-11-05 at 15:16, Kaare Rasmussen wrote: > > Thanks. This gives me a few more tools to look at. Boy, do we h

Re: [GENERAL] [SQL] Database Design tool

2002-11-05 Thread Robert Treat
There are actually two sections on the techdocs site now relating to this at http://techdocs.postgresql.org/oresources.php look under the sections ERD Tools and Database Design Not that I'm not looking forward to your article Josh ;-) Robert Treat On Tue, 2002-11-05 at 11:33, Josh Berkus

Re: [SQL] HA PostgreSQL

2002-11-01 Thread Robert Treat
in advance, > If you haven't looked at dbbalancer yet, you might want to. Someone mentioned it just a few days ago in a very similar thread on the general list (iirc) Robert Treat ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] psql history

2002-10-31 Thread Robert Treat
ives (probably the general list would be more fruitful) as this comes up quite often. Robert Treat ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] celko nested set functions

2002-10-02 Thread Robert Treat
s, but not moving. I'm hoping to find something postgresql specific but if not that's ok. Thanks in advance, Robert Treat ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Preventing DELETEs

2002-09-26 Thread Robert Treat
In psuedo-code : create rule on mytable on delete return null Robert Treat On Thu, 2002-09-26 at 15:00, Rajesh Kumar Mallah. wrote: > Hi , > > I have a created a database and a table in it, > > I want to prevent "DELETES" on the table in this > database by everyo

Re: [SQL] Event recurrence - in database or in application code ????

2002-08-21 Thread Robert Treat
recurrence). My question to those of > > you that are > > more experienced in postgresql is whether you would implement this > > functionality in the > > database level using triggers or at the application code level (PHP). > > > > > > Any suggestions, etc

Re: [SQL] Is this valid?

2002-08-12 Thread Robert Treat
I'm going to ask the crazy question of what language/interface are you using to interact with postgres? Based on my interpretation of your question I'd say that won't break (though one of your queries might fail) but then again I may be totally misreading what you wrote... Rober

Re: [SQL] how do I change regional setting for dates?

2002-07-25 Thread Robert Treat
re, but if you check out http://www.postgresql.org/idocs/index.php?sql-set.html and http://www.postgresql.org/idocs/index.php?timezones.html it will explain how to update your internal timezone as needed. Robert Treat On Wed, 2002-07-24 at 15:38, Ligia Pimentel wrote: > I live in Guatemala, and our timezone i

Re: [SQL] [GENERAL] No command history in psql

2002-07-23 Thread Robert Treat
they are supposed to be. Robert Treat On Tue, 2002-07-23 at 10:53, Carmen Wai wrote: > Hello: > > I am upgrading to postgresql version 7.2.1. I found that the psql has not > included the readline library automatically and doesn't have any readline > and history command func

Re: [SQL] how do i import my sql query result to a file

2002-07-18 Thread Robert Treat
not sure I understand the question, but from inside psql you can do: \o FILENAMEsend all query results to file or |pipe Robert Treat On Thu, 2002-07-18 at 17:47, Joseph Syjuco wrote: > how do i import results of my select query to a file >