[GENERAL] Temp Table In SQL Function

2001-09-07 Thread cnliou
Hello! I am trying to create a sql function that returns 2 values using temporary table as the "media": database1=# CREATE FUNCTION SaveNumeric(int2,int2) RETURNS INTEGER AS ' database1'# CREATE TEMP TABLE mytemp(a int2,b int2); database1'# INSERT INTO mytemp VALUES ($1+1,$2+100); database1'#

Re: [GENERAL] recursive text construction in plpgsql?

2001-09-07 Thread Tom Lane
I said: > Frank Miles <[EMAIL PROTECTED]> writes: >> The simple recursive function: >> [ doesn't work ] > Looks like you have found a real bug, but I don't know what it is yet... Now I do :-(. FunctionCache needs to be a read-only data structure; it can't contain the argument block that's built

Re: [GENERAL] What Is The Firing Order?

2001-09-07 Thread cnliou
> I don't think oid order would help, because what > happens if you've say got a trigger and then want > to add another before it? I'd guess the most > general way would be to give triggers some kind of > numeric ordering not associated with anything else, > but then you need ways to set it on cr

[GENERAL] Uniquely identify a connection?

2001-09-07 Thread swalker
Is there a way in postgres to uniquely identify a connection? ie - get something like the process id ? select pid(); Thanks Steve ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

Re: [GENERAL] recursive text construction in plpgsql?

2001-09-07 Thread Tom Lane
Frank Miles <[EMAIL PROTECTED]> writes: > The simple recursive function: > [ doesn't work ] Hmm. In development sources I get regression=# SELECT testRecurse(4,3); NOTICE: Error occurred while executing PL/pgSQL function testrecurse NOTICE: line 7 at assignment ERROR: MemoryContextAlloc: inv

[GENERAL] recursive text construction in plpgsql?

2001-09-07 Thread Frank Miles
The simple recursive function: -- DROP FUNCTION testRecurse(int,int); CREATE FUNCTION testRecurse(int,int) RETURNS text AS ' DECLARE rslttext; BEGIN IF $1 = 0 THEN rslt= CAST($2 AS TEXT); E

Re: [GENERAL] Problem w/ dumping huge table and no disk space

2001-09-07 Thread Brett Schwarz
There is no way to add a temporary hard drive, or mount another drive on another machine, and then dump to that? David Ford wrote: > > Help if you would please :) > > I have a 10million+ row table and I've only got a couple hundred megs > left. I can't delete any rows, pg runs out of disk spac

Re: [GENERAL] Great Bridge ceases operations

2001-09-07 Thread Micah Yoder
On Friday 07 September 2001 08:57, you wrote: > This kind of sad news is coming all too frequently > now. Yep. I really thought Great Bridge was one of the few Open Source companies that would really thrive, at least once the economy picks up again. This was a real shock. Does that leave Red

Re: [GENERAL] moving char() to varchar()

2001-09-07 Thread Alvaro Herrera
On Fri, 7 Sep 2001, Tom Lane wrote: > Andrew Sullivan <[EMAIL PROTECTED]> writes: > > 1. I thought the SQL spec required varchar() not to pad. Is it > > just that, because of the way pg_dump saved the char() data (as > > blank-padded) that the varchar() field preserves the padded data? > > You

Re: [GENERAL] moving char() to varchar()

2001-09-07 Thread Tom Lane
Andrew Sullivan <[EMAIL PROTECTED]> writes: > 1.I thought the SQL spec required varchar() not to pad. Is it > just that, because of the way pg_dump saved the char() data (as > blank-padded) that the varchar() field preserves the padded data? Right. Trailing blanks in the presented data *s

Re: [GENERAL] What Is The Firing Order?

2001-09-07 Thread Bruce Momjian
> > That seems fairly arbitrary; someone else might wish the opposite, > > depending on the details of what they want to do. > > We should probably check first whether the SQL standard has anything to > say about the relative ordering of foreign key cascade actions versus > triggers. (I would te

Re: [GENERAL] moving char() to varchar()

2001-09-07 Thread Brent R. Matzelle
--- Andrew Sullivan <[EMAIL PROTECTED]> wrote: > 1.I thought the SQL spec required varchar() not to pad. Is > it > just that, because of the way pg_dump saved the char() data > (as > blank-padded) that the varchar() field preserves the padded > data? The pg_dump utility dumps out the data

Re: [GENERAL] moving char() to varchar()

2001-09-07 Thread Mitch Vincent
> 1. I thought the SQL spec required varchar() not to pad. Is it > just that, because of the way pg_dump saved the char() data (as > blank-padded) that the varchar() field preserves the padded data? A dump from a char() field keeps the NULL padding even in the dump file I assume, so when you wen

Re: [GENERAL] Idea: jobs.postgresql.org

2001-09-07 Thread Thomas T. Thai
On Fri, 7 Sep 2001, Roderick A. Anderson wrote: > On Fri, 7 Sep 2001, Joe Conway wrote: > > > Well, there's already this: > > http://techdocs.postgresql.org/jobs.php try clicking on the login or register.. it doesn't work. maybe that's why? > > Duh! > > > But it currently has no listings :(

[GENERAL] Abort state on duplicated PKey in transactions

2001-09-07 Thread Haroldo Stenger
Hi dear people, I'm not sure if this is for general or for hackers, but let's start here ;-) We are building a RAD tool (GeneXus) support, for PostgreSQL. A problem which arose, is that within a transaction, if one inserts on a table and the PK restriction is violated, the transaction aborts an

[GENERAL] moving char() to varchar()

2001-09-07 Thread Andrew Sullivan
Hi, The developers of our application changed a number of fields from char() to varchar() (which was a Good Thing, for reasons I won't bore you with). Now, I thought I could just do a pg_dump -a on the database, create the new schema, and load the old data into the new schema, and the new varcha

Re: [GENERAL] What Is The Firing Order?

2001-09-07 Thread Peter Eisentraut
Tom Lane writes: > > My another question is: When both UPDATE trigger (and > > its trigger function) and UPDATE CASCADE constraint > > are both defined, is the custom UPDATE trigger or the > > UPDATE CASCADE constraint fired first? > > > I wish the constraint will be fired first. > > That seems f

Re: [GENERAL] What Is The Firing Order?

2001-09-07 Thread Bruce Momjian
Added to TODO: * Allow user to control trigger firing order > On Fri, 7 Sep 2001, Bruce Momjian wrote: > > > > > I think that'd probably work, although I think that you probably > > > > want to ensure that deferred constraint triggers run after normal > > > > triggers and immediate co

Re: [GENERAL] What Is The Firing Order?

2001-09-07 Thread Stephan Szabo
On Fri, 7 Sep 2001, Tom Lane wrote: > Yes, the semantics of immediate and deferred triggers wouldn't change. > I'm just suggesting that when the system has a choice of legal firing > orders, it adopt an "alphabetical order" rule. AFAICS, all it would > take to implement this is for RelationBuild

Re: [GENERAL] What Is The Firing Order?

2001-09-07 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes: >> If we were to modify the code to make the firing order predictable, >> I'd want it to be user-controllable. A simple hack that comes to >> mind is to fire triggers in alphabetical order by name --- then you >> can easily arrange for custom triggers to

Re: [GENERAL] query help

2001-09-07 Thread Stephan Szabo
On Fri, 7 Sep 2001, Jeff Patterson wrote: > This seems like such a basic function that I'm sure I am missing something > fundamental. I have a table, say xref, whose columns are primary key values for > other tables. Some of theses keys may be NULL for a given row in xref. I want > to create a qu

Re: [GENERAL] What Is The Firing Order?

2001-09-07 Thread Stephan Szabo
On Fri, 7 Sep 2001, Tom Lane wrote: > <[EMAIL PROTECTED]> writes: > > The document says: "Also, if more than one trigger is > > defined for the same event on the same relation, the > > order of trigger firing is unpredictable. > > Yup, and it means what it says. > > > My another question is: W

Re: [GENERAL] Idea: jobs.postgresql.org

2001-09-07 Thread wsheldah
One of the things on the TODO list at jobs.perl.org is to make it "themable," with jobs.apache.org given as an example. Perhaps a jobs.postgresql.org could be set up in conjunction with them? Wes "Roderick A. Anderson" <[EMAIL PROTECTED]> on 09/07/2001 10:42:42 AM To: [EMAIL PROTECTED]

[GENERAL] query help

2001-09-07 Thread Jeff Patterson
This seems like such a basic function that I'm sure I am missing something fundamental. I have a table, say xref, whose columns are primary key values for other tables. Some of theses keys may be NULL for a given row in xref. I want to create a query that returns the corresponding entries in the o

[GENERAL] Idea: jobs.postgresql.org

2001-09-07 Thread Roderick A. Anderson
I was going to suggest this last week amd now it looks like it might be more important. (There was a namserver problem with this account soI never got Bruce's original post - just the replys/follow-ups.) Well since I got layed off last December it has been interesting trying to find employment i

Re: [GENERAL] What Is The Firing Order?

2001-09-07 Thread Tom Lane
<[EMAIL PROTECTED]> writes: > The document says: "Also, if more than one trigger is > defined for the same event on the same relation, the > order of trigger firing is unpredictable. Yup, and it means what it says. > My another question is: When both UPDATE trigger (and > its trigger function) a

Re: [GENERAL] Great Bridge ceases operations

2001-09-07 Thread Andrew Gould
This kind of sad news is coming all too frequently now. I wish you all the best. Andrew --- Bruce Momjian <[EMAIL PROTECTED]> wrote: > Effective tomorrow, Great Bridge LLC will cease > operations. Full > information can be obtained from: > > http://www.greatbridge.com/ > > Great Brid