Re: [GENERAL] Create trigger problem :

2001-03-12 Thread Stephan Szabo
Trigger functions need to take no arguments and return opaque. You can use NEW or OLD inside the function and arguments given in the create trigger statement are passed into the function in a special way (in plpgsql, it's TG_ARGV[] i believe) On Fri, 9 Mar 2001, De Leeuw Guy wrote: > Hi all, >

Re: [GENERAL] Large Text Fields and TOAST

2001-03-12 Thread Stephan Szabo
Well, TOAST should be fairly transparent to users I believe. TOAST values should be compressed or stored separately from the rest of the row's data to get around the 8-32k block size. There's also the large object support which is something else entirely. On Fri, 9 Mar 2001, Lee Russell wrote:

[GENERAL] Re: pqReadData() - backend unexpectedly closed the channel

2001-03-12 Thread Rob Arnold
I can make this happen consistently with Perl DBI by placing a $dbh->disconnect() in the DESTROY subroutine of an object. I doubt the two issues have much in common, but there's my $.02. You might post to the list (not me, I'm ignorant) how you managed to make this happen. --rob - Original

[GENERAL] help with simple rule

2001-03-12 Thread Chris Hayner
here is the table: Table "testx" Attribute | Type | Modifier ---+-+ starter | integer | not null second| text| default timestamp('now') I am trying to make a rule which states:

[GENERAL] Re: pqReadData() - backend unexpectedly closed the channel

2001-03-12 Thread Tom Lane
"Scott Price" <[EMAIL PROTECTED]> writes: > The last response I saw = > from postgresql.org to Frank was from a fellow Tom Lane asking to see a = > core dump. Since I experienced this problem I would like to send you a = > core dump of my file (which is gzipped), core.gz No, I wanted to see a ba

Re: [SQL] Re: [GENERAL] MySQLs Describe emulator!

2001-03-12 Thread Patrick Welche
On Tue, Mar 06, 2001 at 10:38:43AM -0500, Michael Fork wrote: > try starting psql with the -E option -- this displays all queries used > internally to the screen, i.e.: Sorry, hadn't read this one before posting... Thanks to the "moderating" it'll all be out of synch anyway but.. Patrick --

Re: [GENERAL] socket file must reside in /tmp?

2001-03-12 Thread Tom Lane
tc lewis <[EMAIL PROTECTED]> writes: > when configuring and installing postgresql, is there any way to specify > where pgsql/the postmaster will put its socket file (.s.PGSQL.)? Possible in 7.1, but not in earlier releases. Note that moving around the socket file is likely to create compatib

[GENERAL] pqReadData() - backend unexpectedly closed the channel

2001-03-12 Thread Scott Price
To: Tom Lane, and Postgresql.org staff, This is a message in response to the one sent by Frank Miles on Tue 7 Nov 2000 11:11:29 -0800 (PST). I have been experiencing the same problem as the gentleman, Frank Miles, when running Postgre SQL. I have been repeatedly getting "pqReadData - backend

[GENERAL] Large Text Fields and TOAST

2001-03-12 Thread Lee Russell
hi, I an using postgresql-7.1beta4 and am trying to use the large text fields. I have heard of TOAST. There is little documentation. I found one section about creating a data type, then creating two functions to convert the data types. Is this how TOAST is implemented? Am I on the right trac

RE: [GENERAL] COPY problem

2001-03-12 Thread Creager, Robert S
Tom believes there may be a memory leak, which would be causing the (strangely enough) memory problem. Didn't think about reducing the import size. What I might try in that case would be to re-connect to the db periodically, rather than splitting the file. The problem becomes unmanageable afte

[GENERAL] socket file must reside in /tmp?

2001-03-12 Thread tc lewis
when configuring and installing postgresql, is there any way to specify where pgsql/the postmaster will put its socket file (.s.PGSQL.)? it seems to always put it in /tmp. i can't seem to find a tmpdir option or anything similar to use as a configure option. anything? -tcl. ---

[GENERAL] Determine Time in other Time Zone

2001-03-12 Thread Marc Wrubleski
I need to determine the users time in another Time Zone for the time now(). I tried to manually add or subtract the difference of hours between the server timezone and the other timezone, but I have to do it for _Every_ timezone. Not only that, but I need to take Daylight Saving Time (DST) into a

[GENERAL] Create trigger problem :

2001-03-12 Thread De Leeuw Guy
Hi all, I try this : CREATE FUNCTION DelArtFather(INT4) RETURNS INT4 AS ' DELETE FROM TArticles WHERE IdArtFather = $1; SELECT 1 AS ignore_this ' LANGUAGE 'sql'; CREATE TRIGGER trigger_TArticles BEFORE DELETE ON TArticles FOR EACH ROW EXECUTE PROCEDURE DelArtFather(old.IdArt); and i

Re: [GENERAL] COPY problem

2001-03-12 Thread Gordon A. Runkle
In article <[EMAIL PROTECTED]>, "Creager, Robert S" <[EMAIL PROTECTED]> wrote: > I think this is a question regarding the backend, but... [snip] > (COPY u FROM stdin). The backend process which handles the db connection > decides that it needs a whole lot of memory, although in a nice > control

[GENERAL] infinity

2001-03-12 Thread Thomas F. O'Connell
is there any integer constant for infinity in postgres? i know such beasts exist (with some bugs) in the date/time domain. it would be nice to have an abstraction for numerology as well as chronology... -tfo ---(end of broadcast)--- TIP 1: subsc

[GENERAL] Case insensitive primary keys

2001-03-12 Thread Jeff Schnitzer
Hello! I've got a question: I'm trying to create a system with a string (varchar) primary key which is *not* case sensitive. Is there any way I can create a primary key column which automatically takes care of this? I'm coming at this problem from a java app server, so my hands are somewhat

Re: [GENERAL] display temp table structure?

2001-03-12 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > There is no user-visible mapping, though the number is the process id. > You could use that. I think you can get the backend process id somehow, > but I am not sure how. Anyone? If you're using libpq, there is a function to retrieve the backend's PID

Re: [GENERAL] -F option again

2001-03-12 Thread Joseph Shraibman
[EMAIL PROTECTED] wrote: > > I think I have been using -F option since > but now I'm not sure. I either start > with pg_ctl or postmaster directly. In any case > man pages suggest that if you can pass optional parameters > to postgres via -o switch from postmaster. I would > think that if I do

Re: [GENERAL] display temp table structure?

2001-03-12 Thread Bruce Momjian
> Thanx Bruce > > What I found is something like pg_temp.25865.0. Do we have some kind of > mapping table between the "real temp table name" and pg_temp*. If there > are more than one temp tables, I need a way to differentiate them. > > Thanks for your help There is no user-visible mapping,

Re: [GENERAL] Postgresql 7.1 Beta 5, Postmaster dead

2001-03-12 Thread Tom Lane
[EMAIL PROTECTED] writes: > Any thoughts what may have casued this? Not from that amount of data. Are there any core-dump files laying about? regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe comm

Re: [GENERAL] Poor Delete performance

2001-03-12 Thread Tom Lane
I've applied a patch for this problem to current sources. The improvement was more than I expected --- a test case involving deleting 8 tuples from a foreign-key-referencing table dropped from ~15min to ~8sec. Insertion of a large number of tuples in one transaction sped up quite a bit too.

Re: [GENERAL] Postrges automatic restart

2001-03-12 Thread KuroiNeko
> Is there a way to automatically restart postgres after a failure 8) /etc/inittab ? -- ÌĤ¯Ç­¤ÏÁͤòÊá¤é¤Ì ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] display temp table structure?

2001-03-12 Thread Limin Liu
Bruce Momjian wrote: > [ Charset ISO-8859-1 unsupported, converting... ] > > > > I was trying to check my temp table structure, but failed (7.1 beta4) > > and I found the following item in the TODO list (without '-'). > > > > * allow psql \d to show temporary table structure > > > > Is there any

Re: [GENERAL] display temp table structure?

2001-03-12 Thread Bruce Momjian
[ Charset ISO-8859-1 unsupported, converting... ] > > I was trying to check my temp table structure, but failed (7.1 beta4) > and I found the following item in the TODO list (without '-'). > > * allow psql \d to show temporary table structure > > Is there any workaround or equivalent SQL avail

[GENERAL] -F option again

2001-03-12 Thread newsreader
I think I have been using -F option since but now I'm not sure. I either start with pg_ctl or postmaster directly. In any case man pages suggest that if you can pass optional parameters to postgres via -o switch from postmaster. I would think that if I do it correctly such options will show up

[GENERAL] please some help on trigger creation

2001-03-12 Thread Feite Brekeveld
Hi, Suppose: create table rawrecords ( myrec text; ); create table cookedrecords ( id varchar(10) not null, name varchar(20) not null, value integer not null ); We insert a record say string: "thisid/thisname/12345" into the rawrecords table. I would like to have a trigge

[GENERAL] Backup and analyse

2001-03-12 Thread Christopher Sawtell
I could not easily find answers to these simple questions. a) Does VACUUMing ( with ANALYSE ) in effect perform a file consistency check on the database structure as a side effect? b) Is it ok to VACUUM while the database is alive and active? c) Can I backup via pg_dump while the database is

RE: [GENERAL] COPY again...

2001-03-12 Thread Creager, Robert S
If the file is truly CSV (comma separated values), you might want to change DELIMITERS '\t' to DELIMITERS ','... Otherwise, include a couple of lines of data... Robert Creager Senior Software Engineer Client Server Library 303.673.2365 V 303.661.5379 F 888.912.4458 P StorageTek INFORMATION made

[GENERAL] Re: [SQL] Permissons on database

2001-03-12 Thread Roland Roberts
> "bk" == Boulat Khakimov <[EMAIL PROTECTED]> writes: bk> How do I grant permissions on everything in the selected bk> databes? bk> GRANT doesnt take as on object database name nor does it bk> accept wild chars Attached is some Perl code I wrote long ago to do this. Thi

Re: [SQL] Re: [GENERAL] Re: MySQLs Describe emulator!

2001-03-12 Thread Mathijs Brands
On Tue, Mar 06, 2001 at 04:37:32PM +0100, Karel Zak allegedly wrote: > On Tue, Mar 06, 2001 at 10:19:13AM -0500, Boulat Khakimov wrote: > > > > Karel Zak wrote: > > > > On Tue, Mar 06, 2001 at 09:14:54AM -0500, Boulat Khakimov wrote: > > > > Tom Lane wrote: > > > > > > > > > > Boulat Khakimov <[E

[GENERAL] Re: [SQL] Date question

2001-03-12 Thread clayton cottingham
Francis Solomon wrote: > > Hi Boulat, > > stasis=# select (now() + '1 year')::date; > ?column? > > 2002-03-06 > (1 row) > > Hope this helps > > Francis > > > Hi, > > > > Im a little bit stuck here. > > > > Does anyone know how to get date in format '-MM-DD' of a date one >

[GENERAL] Re: [SQL] Undefined symbol

2001-03-12 Thread Mathijs Brands
On Tue, Mar 06, 2001 at 06:44:31PM -0500, Boulat Khakimov allegedly wrote: > testdb=# select encode('bob','bob'); > ERROR: Load of file /home/boulat/Funio.com/database/encode.so failed: > /home/boulat/Funio.com/database/encode.so: undefined symbol: > BF_cfb64_encrypt > > thats the function that

[GENERAL] Re: [SQL] Date question

2001-03-12 Thread Jie Liang
you can say: (now() + '1year'::timespan)::date Jie LIANG St. Bernard Software 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 [EMAIL PROTECTED] www.stbernard.com www.ipinc.com On Tue, 6 Mar 2001, Boulat Khakimov wrote: > Hi, > > Im a little bit stuck here.

Re: [GENERAL] Postgresql.org website search

2001-03-12 Thread The Hermit Hacker
On Fri, 9 Mar 2001, Tim Frank wrote: > I apologise if this has been posted/asked already, but since it has been > about a week and it hasn't been "fixed" I needed to ask. Every time I > issue a search at http://www.postgresql.org/search.mpl even on the > easiest of search items, such as "p

[GENERAL] Comipling error plz help

2001-03-12 Thread Christian Marschalek
I get the followig error although TK is installed -start make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/mnt/hdb/src/postgresql-7.0.3/src/bin/pgaccess' make[2]: Entering directory `/mnt/hdb/src/postgresql-7.0.3/src/bin/pgtclsh' gcc -I../../include -I../../backe

Re: [GENERAL] Poor Delete performance

2001-03-12 Thread Tom Lane
Bill Huff <[EMAIL PROTECTED]> writes: > There is a foreign key constraint, but that is accomplished by an > INSERT/UPDATE trigger. I don't see why that should cause any problems. Ah, I believe I see the problem: it's the inefficient implementation of AFTER EVENT triggers. The existence of e

Re: [GENERAL] Delete Cascade

2001-03-12 Thread Stephan Szabo
Add ON DELETE CASCADE to the references in book. On Mon, 12 Mar 2001, Marcelo Pereira wrote: > Hi, > > I am in trouble deleting rows in cascade. > > I have a scheme like this: > > create table author (author_cod integer primary key, author_name char(20)); > create table book (book_cod intege

Re: [GENERAL] Poor Delete performance

2001-03-12 Thread Stephan Szabo
As an outside chance, does the table in question have any constraints defined on it? On Mon, 12 Mar 2001, Bill Huff wrote: > I am having some performance issues with deletion. > > It appears that in deleting records from a table with a significant > number or rows ( in this case 1.3 mill

Re: [GENERAL] Poor Delete performance

2001-03-12 Thread Bill Huff
There is a foreign key constraint, but that is accomplished by an INSERT/UPDATE trigger. I don't see why that should cause any problems. -- Bill On Mon, Mar 12, 2001 at 08:27:51AM -0800, Stephan Szabo wrote: > > As an outside chance, does the table in question have any constraints > defin

[GENERAL] Re: Create trigger problem :

2001-03-12 Thread Mark G. Gilmore
Instead of sending old.ldArt in as a parameter, try just referencing old inside the function body. So the function then has no argument. Mark "De Leeuw Guy" <[EMAIL PROTECTED]> wrote in message 98imbv$2hk2$[EMAIL PROTECTED]">news:98imbv$2hk2$[EMAIL PROTECTED]... > Hi all, > > I try this : > >

Re: [GENERAL] Counting elements of an array

2001-03-12 Thread Renaud Tthonnart
Sorry!! It works very well! Renaud THONNART > Renaud Tthonnart <[EMAIL PROTECTED]> writes: > > I would like to know how I can get the number of elements of an array. > > There is a function that returns an array's dimensions as a text string: > > regression=# select array_dims( '{1,2,3}'::int[

Re: [GENERAL] Counting elements of an array

2001-03-12 Thread Renaud Tthonnart
Tom Lane wrote: > Renaud Tthonnart <[EMAIL PROTECTED]> writes: > > I would like to know how I can get the number of elements of an array. > > There is a function that returns an array's dimensions as a text string: > > regression=# select array_dims( '{1,2,3}'::int[] ); > array_dims > --

[GENERAL] Re: Delete Cascade

2001-03-12 Thread Karel Zak
On Mon, Mar 12, 2001 at 12:07:13PM -0300, Marcelo Pereira wrote: > Hi, > > I am in trouble deleting rows in cascade. > > I have a scheme like this: > > create table author (author_cod integer primary key, author_name char(20)); > create table book (book_cod integer primary key, book_autor integ

Re: [GENERAL] Poor Delete performance

2001-03-12 Thread Tom Lane
Bill Huff <[EMAIL PROTECTED]> writes: > It appears that in deleting records from a table with a significant > number or rows ( in this case 1.3 million ) it takes about 1 hour per > 100K rows deleted if deleting more then 400K at a time. This sounds > way to slow to me. Me too. What PG

[GENERAL] Delete Cascade

2001-03-12 Thread Marcelo Pereira
Hi,   I am in trouble deleting rows in cascade.   I have a scheme like this:   create table author (author_cod integer primary key, author_name char(20)); create table book (book_cod integer primary key, book_autor integer references author(author_cod), book_title char(30));   I would like

Re: [GENERAL] Re: Anyone can create tables!

2001-03-12 Thread martin . chantler
I have not been following the start of this thread but I was myself wondering about the security of DB access over the web I have been playing with JSP and servlets with JDBC access to PG (I guess the principal is the same as using other scripting languages.) I noticed that it appears impossible

Re: [GENERAL] Data type for storing images?

2001-03-12 Thread Frank Joerdens
On Sun, Mar 11, 2001 at 08:48:21PM -0500, Tom Lane wrote: [ . . . ] > bytea is probably your best bet. The 8k limit is toast in 7.1, btw. Is that whay you named it TOAST, in order to be able to say that? :))) Regards, Frank ---(end of broadcast)-