Re: [GENERAL] ERROR: cache lookup failed for type 0

2005-01-07 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > Tzahi Fadida <[EMAIL PROTECTED]> writes: > > well, I tried the heap_deformtuple and I am getting now: > > select testgetrows(); > > server closed the connection unexpectedly > > You didn't palloc the values array. Any reasonable compiler would have > warned

Re: [GENERAL] MS-SQL to PostgreSQL

2005-01-07 Thread Alam Surya
Hi Craig try with this Declare v_maxval integer; v_minval integer; Begin Select max(value),min(value) into v_maxval,v_minval from ABC; end; or see SELECT INTO from postgresql documentation regards, Alam Surya - Original Message --

Re: [GENERAL] Problem creating trigger-function with arguments (8.0rc4)

2005-01-07 Thread Michael Fuhr
On Fri, Jan 07, 2005 at 03:57:44PM -0700, Michael Fuhr wrote: > By accessing TG_ARGV (not TGARGS) in the function. Tom was probably thinking in C when he said TGARGS. The Trigger type (struct Trigger) has a tgargs member. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---

Re: [GENERAL] Problem creating trigger-function with arguments (8.0rc4)

2005-01-07 Thread Michael Fuhr
On Fri, Jan 07, 2005 at 02:00:07PM -0800, David Fetter wrote: > On Fri, Jan 07, 2005 at 03:52:15PM -0500, Tom Lane wrote: > > > > The CREATE TRIGGER parameter comes to the trigger function via > > TGARGS, not as a regular parameter. > > Um, so how would one write a trigger that takes arguments?

returning a setof tuples like a subquery was(RE: [GENERAL] ERROR: cache lookup failed for type 0 )

2005-01-07 Thread Tzahi Fadida
yes you were right it works now. 10x, sorry for the rookie mistake I jumped the gun on the last one. If you will i have another question on the same subject. I want to return a setof tuples without a predetermined return type like a subquery with a join, I don't want to specify a type. for exampl

Re: [GENERAL] ERROR: cache lookup failed for type 0

2005-01-07 Thread Tom Lane
Tzahi Fadida <[EMAIL PROTECTED]> writes: > well, I tried the heap_deformtuple and I am getting now: > select testgetrows(); > server closed the connection unexpectedly You didn't palloc the values array. Any reasonable compiler would have warned you about that BTW. If you don't have compiler war

[GENERAL] bgwriter

2005-01-07 Thread Jeff Davis
I understand that the bgwriter code will not be changed until 8.1 (I'm referring to this issue: ). After reading through the thread, it's my impression that there exists some performance problem with the current method of using a

Re: [GENERAL] ERROR: cache lookup failed for type 0

2005-01-07 Thread Tzahi Fadida
well, I tried the heap_deformtuple and I am getting now: select testgetrows(); server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Failed. !>

Re: [GENERAL] Problem creating trigger-function with arguments (8.0rc4)

2005-01-07 Thread David Fetter
On Fri, Jan 07, 2005 at 03:52:15PM -0500, Tom Lane wrote: > "Florian G. Pflug" <[EMAIL PROTECTED]> writes: > > This is what I tried: > > > CREATE OR REPLACE FUNCTION functions.t_insert_deny(v_message text) > > RETURNS "trigger" AS $$ > > There should probably be a specific error check telling you

[GENERAL] unsubscribe

2005-01-07 Thread Astha Raj
What do I do to unsubscribe from this mailing list? -- Internal Virus Database is out-of-date. Checked by AVG Anti-Virus. Version: 7.0.296 / Virus Database: 265.5.0 - Release Date: 12/9/2004 ---(end of broadcast)--- TIP 8: explain analyze is y

Re: [GENERAL] Books for experienced developers

2005-01-07 Thread Shawn Harrison
Craig Bryden wrote [01/07/05 3:46 AM]: Hi I have vast experience working with MS-SQL. Which books would be good for me to use in order to teach myself PostgreSQL? I need to migrate a MS-SQL Db to PostgreSQL. It contains tablers,views,stored procs, and user defined functions. With no other RDBMS

Re: [GENERAL] need help Connect failure in an applet

2005-01-07 Thread Ragnar Hafstað
On Fri, 2005-01-07 at 13:03 -0500, John Doggett wrote: > When I did that, I now get a different error, that the postmaster is > refusingthe connection. The solution to this problem is supposed to be > adding tcpip_socket = true to the postgresql.conf file and restarting the > postgresql ser

Re: [GENERAL] PostgreSQL users on webhosting

2005-01-07 Thread Jeff Davis
That's an interesting idea. First, you can't (as far as I know) do it with just schemas to seperate the users. There is no default tablespace for an object created inside a given schema. However, there is a default tablespace for a given database. You can (as superuser) create a tablespace and per

Re: [GENERAL] Problem creating trigger-function with arguments (8.0rc4)

2005-01-07 Thread Tom Lane
"Florian G. Pflug" <[EMAIL PROTECTED]> writes: > This is what I tried: > CREATE OR REPLACE FUNCTION functions.t_insert_deny(v_message text) > RETURNS "trigger" AS $$ There should probably be a specific error check telling you that a trigger function can't take any explicit arguments. But there i

Re: [GENERAL] Problem creating trigger-function with arguments (8.0rc4)

2005-01-07 Thread Michael Fuhr
On Fri, Jan 07, 2005 at 09:00:12PM +0100, Florian G. Pflug wrote: > CREATE OR REPLACE FUNCTION functions.t_insert_deny(v_message text) > RETURNS "trigger" AS $$ See the "Trigger Procedures" section of the PL/pgSQL documentation. The first paragraph contains this: Note that the function must

Re: [GENERAL] MS-SQL to PostgreSQL

2005-01-07 Thread Michael Fuhr
On Fri, Jan 07, 2005 at 10:00:47PM +0200, Craig Bryden wrote: > I am not sure of the query part and in particular the assignment of the > values to the variables See SELECT INTO in the PL/pgSQL documentation. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broad

Re: [GENERAL] ERROR: cache lookup failed for type 0

2005-01-07 Thread Tom Lane
Tzahi Fadida <[EMAIL PROTECTED]> writes: > It still doesn't work. btw, I am using 8rc2. Um. The "clean" way to do this is to use BlessTupleDesc and then heap_formtuple. That requires you to break down the original tuple into fields (see heap_deformtuple). Alternatively you could poke the dataty

[GENERAL] Problem creating trigger-function with arguments (8.0rc4)

2005-01-07 Thread Florian G. Pflug
Hi I want to create a simple trigger that denies inserts into a particular table - but, since I want meaningfull error-messages, but don't want to create a function for each table, I figured I could pass the error-message to the trigger-function. This is what I tried: CREATE OR REPLACE FUNCTION f

[GENERAL] MS-SQL to PostgreSQL

2005-01-07 Thread Craig Bryden
Hi Below is a snippet of MS-SQL code. Please can someone translate this to plpgsql for me. ** DECLARE @MaxVal int, @MinVal int SELECT @MaxVal = MAX(Value), @MinVal = MIN(Value) FROM ABC ***

Re: [GENERAL] ERROR: cache lookup failed for type 0

2005-01-07 Thread Tzahi Fadida
It still doesn't work. btw, I am using 8rc2. changed it to: Datumresult; HeapTupletupleCopy; tupleCopy = heap_copytuple(tuple); result = HeapTupleGetDatum(tupleCopy); SRF_RETURN_NEXT(funcctx, result); its probably something with the column description.

Re: [GENERAL] ERROR: cache lookup failed for type 0

2005-01-07 Thread Tom Lane
Tzahi Fadida <[EMAIL PROTECTED]> writes: > Hi, I am learning how to use the c functions and my function below works > when I do: > select testgetrows(); > but when I do select * from testgetrows(); I am getting: > "ERROR: cache lookup failed for type 0" > Whats's the problem? I don't think it's s

Re: [GENERAL] [ANNOUNCE] PostgreSQL 8.0.0 Release Candidate 4

2005-01-07 Thread David Fetter
On Fri, Jan 07, 2005 at 12:04:00PM -0400, Marc G. Fournier wrote: > > Welcome to the New Year all, and the final days of testing for 8.0.0. > > This will hopefully be our final Release Candidate, with a Full > Release happening late next week. There are several Windows related > fixes in this R

[GENERAL] ERROR: cache lookup failed for type 0

2005-01-07 Thread Tzahi Fadida
Hi, I am learning how to use the c functions and my function below works when I do: select testgetrows(); but when I do select * from testgetrows(); I am getting: "ERROR: cache lookup failed for type 0" Whats's the problem? 10x. drop function testgetrows(); CREATE OR REPLACE FUNCTION testgetrows

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Michael Fuhr
On Fri, Jan 07, 2005 at 12:20:13PM +0100, Tino Wildenhain wrote: > Nevertheless you should be able to return 3 cursors you > define in your stored function and use them afterwards. A function can also return SETOF RECORD. However, a query calling such a function would need to provide a column de

Re: [GENERAL] PostgreSQL Deployment

2005-01-07 Thread Steve Atkins
On Fri, Jan 07, 2005 at 06:31:35AM -0800, Hong Ji wrote: > Hi > I am new to PostgreSQL and interested in using PostgreSQL in our > application. > But I have questions regarding what our users have to do to install the > software. > > I can not find documentation on how to deploy application which

Re: [GENERAL] does "select count(*) from mytable" always do a seq

2005-01-07 Thread Scott Ribe
> I guess what I"m really asking is why can't you run aggregates over an index? It's got to do with MVCC and transaction consistency. Running count(*) or an aggregate function on an index could include records that should not be visible to your current transaction. -- Scott Ribe [EMAIL PROTECTE

Re: [GENERAL] PL/Perl

2005-01-07 Thread Joshua D. Drake
with me it doesn't work and returns error message "Query failed: ERROR: creation of function failed: 'require' trapped by operation mask at (eval 2) line 2. in ..." You need to use plperlu. Sincerely, Joshua D. Drake Thanx ---(end of broadcast)--- T

Re: [GENERAL] need help Connect failure in an applet

2005-01-07 Thread John Doggett
Alex, Immediately after sending the inquiry I discovered that default applet behavior is as you desribe and that one must change the java.policy file to allow the connection. When I did that, I now get a different error, that the postmaster is refusingthe connection. The solution

Re: [GENERAL] does "select count(*) from mytable" always do a seq scan?

2005-01-07 Thread Alex Turner
This is interesting... Perhaps a more knowledgable person for pgsql could help us here... I seem to remember something to do with the fact that You can't use aggregate functions over an index... I'm not sure why though. You can do: create index foo on my_table (lower(my_column)) but not create

Re: [GENERAL] Transaction size

2005-01-07 Thread Tom Lane
Alban Hertroys <[EMAIL PROTECTED]> writes: > Is it possible that there is some limitation to the number of statements > in a single transaction? 2^32, and if you'd exceeded it, you'd get a very specific error message saying so. > As they're inserts, and therefore not even touching the same data,

Re: [GENERAL] does "select count(*) from mytable" always do a seq scan?

2005-01-07 Thread Culley Harrelson
On Fri, 07 Jan 2005 16:17:16 +0100, Tino Wildenhain <[EMAIL PROTECTED]> wrote: > > How do you think an index would help if you do an unconditional > count(*)? I really don't know . I don't know the inner workings of database internals but I would guess that there would be some optimized way of c

[GENERAL] Transaction size

2005-01-07 Thread Alban Hertroys
Is it possible that there is some limitation to the number of statements in a single transaction? I'm trying to debug a problem where a program locks up during an insert[*]. Actually, there are 3 simultaneous transactions going on, all doing inserts of about 3000 records each. The problem occur

Re: [GENERAL] need help Connect failure in an applet

2005-01-07 Thread Alex Turner
An applet is only permitted to connect back to the originating server IP that served the HTTP request. If you try to connect to a different address, it will fail with a permissions exception. 127.0.0.1 is the localhost loopback address, and would not work from a remote host either. Alex Turner N

[GENERAL] unsubscribe

2005-01-07 Thread Xinshu Piao
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Astha Raj Sent: Friday, January 07, 2005 8:32 AM To: [EMAIL PROTECTED] Cc: pgsql-general@postgresql.org; [EMAIL PROTECTED] Subject: [GENERAL] unsubscribe ---(end of broadcast)-

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Richard_D_Levine
I installed pgadminIII and really enjoy their built in documentation reader for PostgreSQL. The documentation that came with pgadminIII had been updated for the new version 8 features. Rick

Re: [GENERAL] unsubscribe

2005-01-07 Thread Astha Raj
> Unsubscribe pgsql-general-owner and pgsql-general -- > > > -- Internal Virus Database is out-of-date. Checked by AVG Anti-Virus. Version: 7.0.296 / Virus Database: 265.5.0 - Release Date: 12/9/2004 <> ---(end of broadcast)--- TIP 6: Have you s

Re: [GENERAL] PL/Perl

2005-01-07 Thread Pavel Stehule
Hello, you have to use plperlu, untrusted plperl regards Pavel Stehule On Fri, 7 Jan 2005, ON.KG wrote: > Hi! > > Could I use "use", "require" functions in plperl? > > for example, > > CREATE OR REPLACE FUNCTION perl_func (text) > RETURNS real > AS ' > use HTTP::Request; > use HTTP::Head

[GENERAL] unsubscribe

2005-01-07 Thread Astha Raj
Unsubscribe -- Internal Virus Database is out-of-date. Checked by AVG Anti-Virus. Version: 7.0.296 / Virus Database: 265.5.0 - Release Date: 12/9/2004 <> ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

[GENERAL] need help Connect failure in an applet

2005-01-07 Thread John Doggett
Does anyone know why a connect call will fail with an AccessControlException:access denied(java.net.SocketPermission 127.0.0.1:5432 connect, resolve) from a browser delivered applet?   The applet works fine in the debugger.   I have PostgreSQL running in windows.   Jay This e-mail mess

[GENERAL] PL/Perl

2005-01-07 Thread ON.KG
Hi! Could I use "use", "require" functions in plperl? for example, CREATE OR REPLACE FUNCTION perl_func (text) RETURNS real AS ' use HTTP::Request; use HTTP::Headers; return $value; ' LANGUAGE 'plperl'; with me it doesn't work and returns error message "Query failed: ERROR: creati

[GENERAL] how to migrate a complete win/interbase6 DB

2005-01-07 Thread Alexis Vasquez
very new to postgres. Hi all, I'd just created database in linux/postgres7.4, so it's empty. later with a program that comes with delphi5 (datapump) via odbc try'd to pass metadata and data. but just metadata is passed. so only create tables without data...so I would like to know if could be

[GENERAL] PostgreSQL 8.0.0 Release Candidate 4

2005-01-07 Thread Marc G. Fournier
Welcome to the New Year all, and the final days of testing for 8.0.0. This will hopefully be our final Release Candidate, with a Full Release happening late next week. There are several Windows related fixes in this Release Candidate, with a full list of changes viewable in the Changelog availabl

Re: [GENERAL] does "select count(*) from mytable" always do a seq

2005-01-07 Thread Bruno Wolff III
On Fri, Jan 07, 2005 at 16:17:16 +0100, Tino Wildenhain <[EMAIL PROTECTED]> wrote: > Am Freitag, den 07.01.2005, 06:45 -0800 schrieb Culley Harrelson: > > Hi, > > > > I am using Postgresql 7.4. I have a table with 1.5 million rows. It > > has a primary key. VACUUM FULL ANALYZE is run every nig

[GENERAL] J2SE 1.5 Cache Rowset(JSR 114 )

2005-01-07 Thread Brian Maguire
Just as an FYI. Sun's Cache rowset which is new and part of the J2SE 1.5 is not compatable with Postgres. We have been working with Sun's JAVA development team to resolve the issues through our test cases and debugging. We hope that in a future patch update that the issues will be resolved.

Re: [GENERAL] does "select count(*) from mytable" always do a seq

2005-01-07 Thread Tino Wildenhain
Am Freitag, den 07.01.2005, 06:45 -0800 schrieb Culley Harrelson: > Hi, > > I am using Postgresql 7.4. I have a table with 1.5 million rows. It > has a primary key. VACUUM FULL ANALYZE is run every night. There are > 2000-5000 inserts on this table every day but very few updates and > deletes.

[GENERAL] does "select count(*) from mytable" always do a seq scan?

2005-01-07 Thread Culley Harrelson
Hi, I am using Postgresql 7.4. I have a table with 1.5 million rows. It has a primary key. VACUUM FULL ANALYZE is run every night. There are 2000-5000 inserts on this table every day but very few updates and deletes. When I select count(*) from this table it is using a sequence scan. Is this

Re: [GENERAL] PostgreSQL Deployment

2005-01-07 Thread Lonni J Friedman
Which OS are you planning to use? There are pre-built RPMs for Linux, and pre-compiled binaries for Windows. On Fri, 7 Jan 2005 06:31:35 -0800, Hong Ji <[EMAIL PROTECTED]> wrote: > Hi > I am new to PostgreSQL and interested in using PostgreSQL in our > application. > But I have questions regardi

[GENERAL] PostgreSQL Deployment

2005-01-07 Thread Hong Ji
Hi I am new to PostgreSQL and interested in using PostgreSQL in our application. But I have questions regarding what our users have to do to install the software. I can not find documentation on how to deploy application which uses PostgreSQL. Or does the user have to run separate setup (beside

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Joshua D. Drake
Craig Bryden wrote: Hi Michael I am having some problems porting my Stored Procedures. I am using the pl/pgsql language. Instead of irritating/spamming everyone on this mailing list, I was hoping that there would be a comprehensive book that focusses on how to do DB things in PostgreSQL, but tha

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Geoffrey
Craig Bryden wrote: Hi I am a very experienced MS-SQL developer. I am looking to port a database to PostgreSQL. Which books that are available would be ideal for someone who is already an experienced DB developer? If you are experienced, I'd say you'd save yourself some cash and be perfectly fin

Re: [GENERAL] Global/persistent variables

2005-01-07 Thread Ronnie Meier Ramos
Thanks for all answers! Unfortunatly, faking them with some C functions would be very complex because in this application's case most of this variables are record types and some are arrays (pl/tables)... :-( It seems that creating temp tables (and some api functions) would be a little bit easie

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Tino Wildenhain
On Fri, 2005-01-07 at 12:17 +0100, Patrick FICHE wrote: > No, this is only one result-set. > MS SQL Server is able to return multiple result-set. > > For example, one SQL Server function can return the result of the following > queries : > SELECT * FROM Table1 > SELECT * FROM Table2 > SELECT * FRO

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Adam Witney
It has been able to do this for some time now... Take a look 33.4.4. SQL Functions Returning Sets http://www.postgresql.org/docs/7.4/static/xfunc-sql.html > I'm afraid this is still a problem. > From my knowledge, Postgres function is able to return a single result-set > not multiple. > I may

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Patrick FICHE
No, this is only one result-set. MS SQL Server is able to return multiple result-set. For example, one SQL Server function can return the result of the following queries : SELECT * FROM Table1 SELECT * FROM Table2 SELECT * FROM Table3 with Table1, Table2 and Table3 having different structures...

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Tino Wildenhain
On Fri, 2005-01-07 at 11:56 +0100, Patrick FICHE wrote: > I'm afraid this is still a problem. > From my knowledge, Postgres function is able to return a single result-set > not multiple. > I may have missed some facility... see http://techdocs.postgresql.org/guides/SetReturningFunctions or http:

Re: [GENERAL] functions in postgresql

2005-01-07 Thread Pavel Stehule
Hello, You can use pgjobs-1.00.133-src.tar.gz from gbrog http://gborg.postgresql.org/ - really confortable scheduler for postgresql, but in C++. Regards Pavel On Thu, 6 Jan 2005 [EMAIL PROTECTED] wrote: > Is there a way to write a function in postgresql and have the database run > it on a s

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Patrick FICHE
I'm afraid this is still a problem. >From my knowledge, Postgres function is able to return a single result-set not multiple. I may have missed some facility... Regards, Patrick --- Patrick Fiche email : [EM

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Tino Wildenhain
On Fri, 2005-01-07 at 11:25 +0100, Patrick FICHE wrote: > Hi Craig, > > 2 years ago, I had to do some porting from MS SQL to Postgres. > All the application logic was coded in stored procedures... > > The major problem I was faced to, was to port procedures returning multiple > result-sets... At

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Patrick FICHE
Hi Craig, 2 years ago, I had to do some porting from MS SQL to Postgres. All the application logic was coded in stored procedures... The major problem I was faced to, was to port procedures returning multiple result-sets... Another problem was that there is no default value for stored procedures

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Craig Bryden
Hi Michael I am having some problems porting my Stored Procedures. I am using the pl/pgsql language. Instead of irritating/spamming everyone on this mailing list, I was hoping that there would be a comprehensive book that focusses on how to do DB things in PostgreSQL, but that does not spend too

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Michael Fuhr
On Fri, Jan 07, 2005 at 11:33:52AM +0200, Craig Bryden wrote: > I am a very experienced MS-SQL developer. I am looking to port a database > to PostgreSQL. Which books that are available would be ideal for someone > who is already an experienced DB developer? PostgreSQL has good documentation so

[GENERAL] Books for experienced developers

2005-01-07 Thread Craig Bryden
Hi I have vast experience working with MS-SQL. Which books would be good for me to use in order to teach myself PostgreSQL? I need to migrate a MS-SQL Db to PostgreSQL. It contains tablers,views,stored procs, and user defined functions. Thanks Craig _

Re: [GENERAL] PostgreSQL users on webhosting

2005-01-07 Thread Csaba Nagy
On Wed, 2005-01-05 at 21:34, Jeff Davis wrote: > Benefits of multiple instances: > (1) Let's say you're using the one-instance method and one of your web > users is a less-than-talented developer, and makes an infinite loop that > fills the database with garbage. Not only will that hurt performance

[GENERAL] Books for experienced DB developer

2005-01-07 Thread Craig Bryden
Hi I am a very experienced MS-SQL developer. I am looking to port a database to PostgreSQL. Which books that are available would be ideal for someone who is already an experienced DB developer? Thanks Craig _ Pop-up ads giving you a