[GENERAL] function corresponging to over in db2

2005-01-06 Thread vinita bansal
Hi, I have a query of the form select min(tab1.a) over(partition by tab1.b tab2.a tab1.c) from . in db2. What will be the corresponding query for postgres. Does Postgres have a function which provides the same functionality?? Regards, Vinita Bansal

Re: [GENERAL] Merging Data from Multiple DB

2005-01-06 Thread anon permutation
Thank you for the feedback. I am considering just centralizing pk generation to the HQ. Basically, every so often, the branch will connect back to HQ to get back a block of pk for each table. This way, performance impact is limited and maintainence is simple. thanks. From: Joe Conway

Re: [GENERAL] function corresponging to over in db2

2005-01-06 Thread Martijn van Oosterhout
On Thu, Jan 06, 2005 at 08:00:13AM +, vinita bansal wrote: Hi, I have a query of the form select min(tab1.a) over(partition by tab1.b tab2.a tab1.c) from . in db2. What will be the corresponding query for postgres. Does Postgres have a function which provides the same

[GENERAL] postgresql-contrib risks?

2005-01-06 Thread Andre Felipe Machado
Hello, My hosting provider is unwilling to install postgresql-contrib package, fearing that it will negatively impact other users, brake their sites, or security flaws and so on. Are there any risks involved? I need pgcrypto digest function. Is there a no risk install procedure. If he installs

Re: [GENERAL] postgresql-contrib risks?

2005-01-06 Thread Martijn van Oosterhout
Generally, the stuff in pgcontrib, when installed, only affect a single database. Any external C code is implemented as shared libraries and is loaded on demand. For databases not configured, they won't even see them. As for security risks, this is the only real issue. The code is not in the main

[GENERAL] unsubscribe

2005-01-06 Thread Robin M.
unsubscribe ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

[GENERAL] Query, view join question.

2005-01-06 Thread Joost Kraaijeveld
Hi all, I have 2 tables: table1 with the columns objectid, refobjectid, commonvaluecol and value1. table2 with the columns objectid, refobjectid, commonvaluecol and value2. A select * from table2 where commonvaluecol = 123 and value2 0 returns no rows. I create a view: create view

Re: [GENERAL] Happiness is a cross database link...

2005-01-06 Thread Scott Marlowe
On Wed, 2005-01-05 at 18:23, Alex Turner wrote: I am trying to find out some information on how to set up a cross database links so that I can have queries and foreign keys that cross a physical database. This is not just a technical requirement, but a legal one (The client requires that we

Re: [GENERAL] Query, view join question.

2005-01-06 Thread Tom Lane
Joost Kraaijeveld [EMAIL PROTECTED] writes: Hi all, I have 2 tables: table1 with the columns objectid, refobjectid, commonvaluecol and value1. table2 with the columns objectid, refobjectid, commonvaluecol and value2. A select * from table2 where commonvaluecol = 123 and value2 0

Re: [GENERAL] Query, view join question.

2005-01-06 Thread Joost Kraaijeveld
Hi Tom, I could give you access to the database itself if needed. But these are the actual tables and view. I hope I will never make any tpo's again to upset you this way. CREATE TABLE abo_his ( klantnummer int4, abonnement int2, artikelnummer int4, omschrijving char(40),

[GENERAL] pg_dump dependencies

2005-01-06 Thread Eric E
Hi all, I have a question about pg_dump. I am backing up a database using pg_dump in text mode, which works perfectly for me, with one exception. I have a view vwDependentView which references another view, vwIndependentView. However, when I feed my dump script to psql, it is attempting

[GENERAL] Question about varchar and text

2005-01-06 Thread Stewart, Robert D (COT)
Title: Question about varchar and text What is the difference between varchar and text? I have heard that you can use text instead of varchar and this could speed up your tables. Robert Stewart Network Eng Governor's Office of Technology 101 Cold Harbor Work # 502 564 9696 Cell # 502

[GENERAL] functions in postgresql

2005-01-06 Thread RobertD . Stewart
Title: functions in postgresql Is there a way to write a function in postgresql and have the database run it on a schedule? I would like the database to run a function on every Friday. Thanks Robert Stewart Network Eng Governor's Office of Technology 101 Cold Harbor Work # 502 564

Re: [GENERAL] functions in postgresql

2005-01-06 Thread Joshua D. Drake
[EMAIL PROTECTED] wrote: Is there a way to write a function in postgresql and have the database run it on a schedule? I would like the database to run a function on every Friday. Use cron or windows scheduler. J Thanks Robert Stewart Network Eng Governor's Office of Technology 101 Cold Harbor

Re: [GENERAL] pg_dump dependencies

2005-01-06 Thread Michael Fuhr
On Thu, Jan 06, 2005 at 12:10:26PM -0500, Eric E wrote: I have a question about pg_dump. I am backing up a database using pg_dump in text mode, which works perfectly for me, with one exception. I have a view vwDependentView which references another view, vwIndependentView. However,

Re: [GENERAL] Question about varchar and text

2005-01-06 Thread Derik Barclay
I don't know about running faster, but I believe the only difference between the two in postgres is that a varchar has a limit on input. They are stored and indexed the same. On January 6, 2005 12:25 pm, Stewart, Robert D (COT) wrote: What is the difference between varchar and text? I have

Re: [GENERAL] Question about varchar and text

2005-01-06 Thread Thomas Braad Toft
Hi! Stewart, Robert D (COT) wrote: What is the difference between varchar and text? I have heard that you can use text instead of varchar and this could speed up your tables. http://www.postgresql.org/docs/7.4/interactive/datatype-character.html Quote: Tip: There are no performance

Re: [GENERAL] Query, view join question.

2005-01-06 Thread vhikida
You haven't given the complete information but the following is just a guess. It seems that abonnement is in both tables. The view is stating abo_his.abonnement = 238 I assume that your initial query was WHERE abo_klt.abonnement = 238 and AND abo_klt.afgewerkt 2 My guess is that you are

[GENERAL] Editor: Syntax highlighting and stored procedures surrounded by '

2005-01-06 Thread Eric Brown
I use emacs and syntax highlighting is great -- except that because stored procedures are completely enclosed between two single quotes, all the coloring is off for that portion. Is there a way to not surround stored procedures by quotes or does anybody have a solution that works for them?

Re: [GENERAL] Question about varchar and text

2005-01-06 Thread Joshua D. Drake
Derik Barclay wrote: I don't know about running faster, but I believe the only difference between the two in postgres is that a varchar has a limit on input. They are stored and indexed the same. There is a theory that text is faster than varchar, because postgresql doesn't have to check text.

Re: [GENERAL] pg_dump dependencies

2005-01-06 Thread Eric E
Hi Michael, Well, I dumped the database from two different versions of Postgres (on different machines), using both pg_dump 8.0.0beta2 and pg_dump 7.4.2 (which correspond to the respective server versions). I only restored on the 8.0.0beta machine, though. Would that make a difference? I

Re: [GENERAL] Query, view join question.

2005-01-06 Thread Tom Lane
Joost Kraaijeveld [EMAIL PROTECTED] writes: CREATE OR REPLACE VIEW even AS SELECT DISTINCT abo_his.klantnummer, abo_his.artikelnummer, abo_his.code_retour, abo_klt.aantal_abonnementen, abo_klt.afgewerkt FROM abo_his JOIN abo_klt ON abo_his.klantnummer = abo_klt.klantnummer WHERE

Re: [GENERAL] pg_dump dependencies

2005-01-06 Thread Tom Lane
Michael Fuhr [EMAIL PROTECTED] writes: On Thu, Jan 06, 2005 at 12:10:26PM -0500, Eric E wrote: I have a question about pg_dump. I am backing up a database using pg_dump in text mode, which works perfectly for me, with one exception. I have a view vwDependentView which references another

Re: [GENERAL] Query, view join question.

2005-01-06 Thread Joost Kraaijeveld
Hi Tom, [EMAIL PROTECTED] schreef: Joost Kraaijeveld [EMAIL PROTECTED] writes: CREATE OR REPLACE VIEW even AS SELECT DISTINCT abo_his.klantnummer, abo_his.artikelnummer, abo_his.code_retour, abo_klt.aantal_abonnementen, abo_klt.afgewerkt FROM abo_his JOIN abo_klt ON

[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)

Re: [GENERAL] Query, view join question.

2005-01-06 Thread Tom Lane
Joost Kraaijeveld [EMAIL PROTECTED] writes: CREATE OR REPLACE VIEW even AS SELECT DISTINCT abo_his.klantnummer, abo_his.artikelnummer, abo_his.code_retour, abo_klt.aantal_abonnementen, abo_klt.afgewerkt FROM abo_his JOIN abo_klt ON abo_his.klantnummer = abo_klt.klantnummer WHERE

Re: [GENERAL] Query, view join question.

2005-01-06 Thread vhikida
I think I stated in my previous post but in order to make your view consistent with your original query I think you should do: CREATE OR REPLACE VIEW even AS SELECT DISTINCT abo_his.klantnummer, abo_his.artikelnummer, abo_his.code_retour, abo_klt.aantal_abonnementen, abo_klt.afgewerkt FROM

Re: [GENERAL] Query, view join question.

2005-01-06 Thread vhikida
I think there is an echo in here :) It's probably me. I pass for the rest of this thread. Joost Kraaijeveld [EMAIL PROTECTED] writes: CREATE OR REPLACE VIEW even AS SELECT DISTINCT abo_his.klantnummer, abo_his.artikelnummer, abo_his.code_retour, abo_klt.aantal_abonnementen, abo_klt.afgewerkt

Re: [GENERAL] Editor: Syntax highlighting and stored procedures surrounded

2005-01-06 Thread Bruce Momjian
Eric Brown wrote: I use emacs and syntax highlighting is great -- except that because stored procedures are completely enclosed between two single quotes, all the coloring is off for that portion. Is there a way to not surround stored procedures by quotes or does anybody have a solution

Re: [GENERAL] Editor: Syntax highlighting and stored procedures surrounded by '

2005-01-06 Thread Eric Brown
On Jan 6, 2005, at 11:43 AM, Bruce Momjian wrote: Eric Brown wrote: I use emacs and syntax highlighting is great -- except that because stored procedures are completely enclosed between two single quotes, all the coloring is off for that portion. Is there a way to not surround stored procedures by

[GENERAL] question about plpythonu

2005-01-06 Thread Doseok Kim
Dear all, I was setting up plpythonu with port system on FreeBSD. All ports related plpythonu are installed well. But there was an error when I issued createlang plpythonu template1 with postgres user account. It said like bellow. $ createlang plpythonu template1 createlang: language

[GENERAL] DBMS_File Equivalent?

2005-01-06 Thread Dunc
Can a trigger, written in plperl, write to the OS when it fires? I want to write a trigger, in plperl, that builds an RSS feed file with each row that gets added to one of my tables. My database (8 rc 3, on Redhat 9) seems to choke (terminated on signal 11) each time I try to write to the OS

Re: [GENERAL] DBMS_File Equivalent?

2005-01-06 Thread Joshua D. Drake
Dunc wrote: Can a trigger, written in plperl, write to the OS when it fires? I want to write a trigger, in plperl, that builds an RSS feed file with each row that gets added to one of my tables. My database (8 rc 3, on Redhat 9) seems to choke (terminated on signal 11) each time I try to

Re: [GENERAL] Query, view join question.

2005-01-06 Thread Ragnar HafstaĆ°
On Thu, 2005-01-06 at 17:57 +0100, Joost Kraaijeveld wrote: Hi Tom, I could give you access to the database itself if needed. But these are the actual tables and view. I hope I will never make any tpo's again to upset you this way. no-one was upset. the point is just that you are more

Re: [GENERAL] DBMS_File Equivalent?

2005-01-06 Thread Dunc
I wrote: Can a trigger, written in plperl, write to the OS when it fires? I want to write a trigger, in plperl, that builds an RSS feed file with each row that gets added to one of my tables. My database (8 rc 3, on Redhat 9) seems to choke (terminated on signal 11) each time I try to write

Re: [GENERAL] DBMS_File Equivalent?

2005-01-06 Thread Tom Lane
Dunc [EMAIL PROTECTED] writes: Can a trigger, written in plperl, write to the OS when it fires? No, but a plperlu trigger can. My database (8 rc 3, on Redhat 9) seems to choke (terminated on signal 11) each time I try to write to the OS - I would imagine because it's a major security

Re: [GENERAL] DBMS_File Equivalent?

2005-01-06 Thread Joshua D. Drake
In thinking about this I'm wondering if I'm making this harder then it needs to be. If I could write a function that builds, and returns the RSS file that would accomplish what I want - assuming that I could call the function from a webpage. Can Postgres functions be called from a URL,

[GENERAL] Global/persistent variables

2005-01-06 Thread Ronnie Meier Ramos
I'm analysing a conversion of a system from Oracle to PG. The system in case uses a lot of PL/SQL packages and lots of them uses public/static global/persistent variables declared inside its package specification or body. AFAIK PG doesn't have packages - this is not a problem since I can

[GENERAL] unsubscribe

2005-01-06 Thread Robin M.
unsubscribe ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Global/persistent variables

2005-01-06 Thread Tom Lane
Ronnie Meier Ramos [EMAIL PROTECTED] writes: AFAIK PG doesn't have packages - this is not a problem since I can handle it with different schemas or some naming convention, but is there a way to declare persistent variables (that would be visible to any function up to the end of the session)

Re: [GENERAL] Query, view join question.

2005-01-06 Thread Joost Kraaijeveld
Hi both, Thanks for taking the trouble to help me. Based on your responses I realized that a multi key join should do what I wanted and it does. Groeten, Joost Kraaijeveld Askesis B.V. Molukkenstraat 14 6524NB Nijmegen tel: 024-3888063 / 06-51855277 fax: 024-3608416 e-mail: [EMAIL PROTECTED]

Re: [GENERAL] Global/persistent variables

2005-01-06 Thread Scott Ribe
AFAIK PG doesn't have packages - this is not a problem since I can handle it with different schemas or some naming convention, but is there a way to declare persistent variables (that would be visible to any function up to the end of the session) ? AFAIK you'd have to fake it using a temp

Re: [GENERAL] warning: pg_query(): Query failed

2005-01-06 Thread Bruno Wolff III
On Wed, Jan 05, 2005 at 11:16:29 -0800, Aaron Steele [EMAIL PROTECTED] wrote: would it be useful to see the IF PLSQL function, or would you recommend a modification to the database.pgsql.inc file? You should probably try looking at the IF function first to see if you can spot it using 2 as

Re: [GENERAL] Global/persistent variables

2005-01-06 Thread Richard_D_Levine
I understand your pain, because PL/SQL is so close to plpgsql the functions should just drop into quotes with renamed parameters, but they don't. Using another language makes the port more difficult. Have you considered functions that store the variable value in the database and read it back from

Re: [GENERAL] postgresql-contrib risks?

2005-01-06 Thread Bruno Wolff III
On Thu, Jan 06, 2005 at 15:09:54 +0100, Martijn van Oosterhout kleptog@svana.org wrote: One question though, if you are granted filesystem access to the server, there's no reason why you couldn't just get the pgcrypto module in your home directory and load it into the server yourself. I

Re: [GENERAL] warning: pg_query(): Query failed

2005-01-06 Thread Bruno Wolff III
On Thu, Jan 06, 2005 at 14:38:53 -0800, Aaron Steele [EMAIL PROTECTED] wrote: hi bruno, Please copy replies to the list so that other people can help and learn from your problem. here's the IF() from psql, although i'm not familiar enough to really know what to look for. do you see

Re: [GENERAL] Global/persistent variables

2005-01-06 Thread Joe Conway
Ronnie Meier Ramos wrote: AFAIK PG doesn't have packages - this is not a problem since I can handle it with different schemas or some naming convention, but is there a way to declare persistent variables (that would be visible to any function up to the end of the session) ? You might be able to

Re: [GENERAL] warning: pg_query(): Query failed

2005-01-06 Thread Aaron Steele
hi bruno, turns out that l.last_comment_uid and l.last_comment_name are integer and char var respectively. since i'm using 7.4.1 with strict boolean casting, is there a better alternative to instantiating a different version of pgsql on my server? In the php code you showed the following

Re: [GENERAL] disabling OIDs?

2005-01-06 Thread Robert Treat
On Sunday 02 January 2005 08:24, Martijn van Oosterhout wrote: On Sat, Jan 01, 2005 at 06:35:30PM -0800, Jeff Davis wrote: On Sun, 2004-12-12 at 20:25 -0800, Lonni J Friedman wrote: OK, thanks. So is there any real benefit in doing this in a generic (non-dspam) sense, or is it just a

Re: [GENERAL] Editor: Syntax highlighting and stored procedures surrounded by '

2005-01-06 Thread John DeSoi
Eric, On Jan 6, 2005, at 2:51 PM, Eric Brown wrote: Great! Well, I had to move to 8.0 anyway to get better support for passing around composite types. So where is the $$ quoting stuff documented? How do I use it? In the 8.0 beta html documentation you can find at this path

[GENERAL] Serial Foreign Key

2005-01-06 Thread Jonathan Stafford
Suppose I have two tables: create table t1 ( idserialnot null ); create table t2 ( idserialnot null, t1integernot null, foreign key (t1) references t1 (id) ); Should the t1 integer actually be a bigint? I ask because when I do select * from t1_id_serial the

[GENERAL] unsubscribe

2005-01-06 Thread Murali Mohan Kasetty
unsubscribe attachment: winmail.dat ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] warning: pg_query(): Query failed

2005-01-06 Thread Bruno Wolff III
On Thu, Jan 06, 2005 at 17:32:30 -0800, Aaron Steele [EMAIL PROTECTED] wrote: hi bruno, turns out that l.last_comment_uid and l.last_comment_name are integer and char var respectively. since i'm using 7.4.1 with strict boolean casting, is there a better alternative to instantiating a

Re: [GENERAL] Serial Foreign Key

2005-01-06 Thread Michael Glaesemann
On Jan 7, 2005, at 14:45, Jonathan Stafford wrote: Suppose I have two tables: create table t1 ( idserialnot null ); create table t2 ( idserialnot null, t1integernot null, foreign key (t1) references t1 (id) ); Should the t1 integer actually be a bigint? I ask