[GENERAL] Re: [HACKERS] pg_dump & blobs - editable dump?

2000-07-12 Thread Philip Warner
At 10:13 12/07/00 -0400, Lamar Owen wrote: >Philip Warner wrote: >> My guess is that this will involve a plain text schema dump, followed by >> all BLOBs in separate files, and a script to load them. To implement this >> I'll obviosly need to be passed a directory/file location for the script >> s

RE: [GENERAL] RE: [HACKERS] pg_dump & blobs - editable dump?

2000-07-12 Thread Peter Mount
No he didn't, just I've been sort of lurking on this subject ;-) Actually, tar files are simply a small header, followed by the file's contents. To add another file, you simply write another header, and contents (which is why you can cat two tar files together and get a working file). http://www

Re: [GENERAL] RE: [HACKERS] pg_dump & blobs - editable dump?

2000-07-12 Thread Jim Mercer
On Thu, Jul 13, 2000 at 12:17:28AM +1000, Philip Warner wrote: > At 14:58 12/07/00 +0100, Peter Mount wrote: > >Why not have it using something like tar, and the first file being stored in > >ascii? > > > >That way, you could extract easily the human readable SQL but still pipe the > >blobs to std

[GENERAL] RE: [HACKERS] pg_dump & blobs - editable dump?

2000-07-12 Thread Peter Mount
Which is why having them on stdout is still a nice option to have. You can pipe the lot through your favourite compressor (gzip, bzip2 etc) and straight on to tape, or whatever. I don't know why you would want them as separate files - just think what would happen to directory search times!! How

[GENERAL] Re: [HACKERS] pg_dump & blobs - editable dump?

2000-07-12 Thread Lamar Owen
Philip Warner wrote: > At 10:13 12/07/00 -0400, Lamar Owen wrote: > >Philip Warner wrote: > >> I'll obviosly need to be passed a directory/file location for the script > >> since I can't pipe seperate files to stdout. > > > >uuencode the blobs, perhaps, using a shar-like format? > For the human

[GENERAL] RE: [HACKERS] pg_dump & blobs - editable dump?

2000-07-12 Thread Philip Warner
At 15:32 12/07/00 +0100, Peter Mount wrote: >Which is why having them on stdout is still a nice option to have. You can >pipe the lot through your favourite compressor (gzip, bzip2 etc) and >straight on to tape, or whatever. Well, the custom format does that, it also does compression and can go t

Re: [GENERAL] RE: [HACKERS] pg_dump & blobs - editable dump?

2000-07-12 Thread Brook Milligan
If anyone can send me a nice interface for reading and writing a tar file from C, I'll do it. I just don't have the inclination to learn about tar internals at the moment. By 'nice' I mean that I would like: I don't know the details of the API, but the NetBSD pax code handles tar formats

Re: [GENERAL] Retrieving INTERVAL as float hours?

2000-07-12 Thread Alex Bolenok
- Original Message - From: "Ken Causey" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 12, 2000 6:14 PM Subject: [GENERAL] Retrieving INTERVAL as float hours? > This may be a stupid question, and feel free to RTFM me, but please > specify the manual/book as I can't se

RE: [GENERAL] RE: [HACKERS] pg_dump & blobs - editable dump?

2000-07-12 Thread Philip Warner
At 15:25 12/07/00 +0100, Peter Mount wrote: >No he didn't, just I've been sort of lurking on this subject ;-) > >Actually, tar files are simply a small header, followed by the file's >contents. To add another file, you simply write another header, and contents >(which is why you can cat two tar fi

[GENERAL] Re: [HACKERS] pg_dump & blobs - editable dump?

2000-07-12 Thread Philip Warner
At 10:38 12/07/00 -0400, Lamar Owen wrote: > >If we simply know that the backup cannot be sent to psql, but a >deshar-ed version can have the schema sent to psql, would that >ameliorate most concerns? > In the current version pg_restore --schema will send the schema to stdout Is that suffi

[GENERAL] Re: [HACKERS] pg_dump & blobs - editable dump?

2000-07-12 Thread Lamar Owen
Philip Warner wrote: > will send the schema to stdout > Is that sufficient? Or are you strictly interested in the text output side > of things? Strictly interested in the text output side of things, for various not-necessarily-good reasons (:-)). -- Lamar Owen WGCR Internet Radio 1 Peter 4:11

[GENERAL] listen/notify

2000-07-12 Thread Tomas B. Winkler
Hi Could someone, please give me a little example on how to use listen/notify mechanism. Or at least point me to some more legible documentation. What I particulary need is that my frontend application is notified on update/insert in a table. Thanx a lot. Tomas Winkler The System Group CSE HUJI

[GENERAL] Are there limits to number of INSERTS inside a Transaction?

2000-07-12 Thread Ken Causey
I can tell this is going to be a good day, it's my second stupid question of the day. Thanks to Alex Bolenok for a complete, concise answer to my first question! Now the question: Can I do too much inside a transaction? In other words, say I was importing a file with 100,000 records and I want

Re: [GENERAL] How to remove a user ?

2000-07-12 Thread Justin Jaynes
You can use the command DROP USER username; at the interactive sql prompt. Justin From: "Fred" <[EMAIL PROTECTED]> Reply-To: "Fred" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: [GENERAL] How to remove a user ? Date: Tue, 11 Jul 2000 21:09:53 GMT Hi, How to remove a user in postgres ? T

[GENERAL] Re: [INTERFACES] Re: Link to postgesql components

2000-07-12 Thread Byron Nikolaidis
While you're at it... How about links to all the other front-ends, like the odbc and jdbc drivers for example? I know there are plenty more front-ends and useful things that should appear in some kind of "links" section or something. I went looking for the jdbc driver on the postgresql.org si

Re: [GENERAL] Another mySQL to PostgreSQL move question

2000-07-12 Thread Giulio Orsero
On Mon, 10 Jul 2000 13:55:24 -0500, you wrote: >> Does PostgreSQL support something like mySQL's auto_increment tag? >See question 4.16.1 of > http://www.postgresql.org/docs/faq-english.html I've never used MySQL, and I'm new to PostgreSQL, can you explain me what does the follow

Re: [GENERAL] Re: [INTERFACES] Re: Link to postgesql components

2000-07-12 Thread Vince Vielhaber
On Mon, 10 Jul 2000, Byron Nikolaidis wrote: > > While you're at it... > > How about links to all the other front-ends, like the odbc and jdbc drivers > for example? I know there are plenty more front-ends and useful things > that should appear in some kind of "links" section or something. A

[GENERAL] Re: [NOVICE] newbie problem on creating table

2000-07-12 Thread Tom Lane
"Thomas Krebs" <[EMAIL PROTECTED]> writes: > TRAP: Failed Assertion("!(((bool) (UserId != 0))):", File: "miscinit.c", > Line: 446) I think what's causing this is that you can't use zero as a Postgres userid. Unfortunately createuser doesn't enforce that restriction; I'll see about fixing that ov

Re: [GENERAL] Re: importing into postgres from access

2000-07-12 Thread Franck Martin
Alex Bolenok wrote: > > At 16:31 11/07/00 +0930, Stephen Davies wrote: > > >You can in fact access an Access database from Linux. > > > > > >Just install the Universal ODBC stuff from OpenLink > > > > URL please, neither openlink.com nor openlink.org seem to be the right > places. > > > > Thanks

Re: [GENERAL] Using curr_val Wisely

2000-07-12 Thread Tom Lane
"Andrew Snow" <[EMAIL PROTECTED]> writes: >> I'm using curr_val('blah_id_seq') in a transaction like so: (in >> pseudo SQL) > curr_val() returns the current value of the sequence, in the current > transaction. More precisely, currval() returns the same value returned by the most recent nextval()

[GENERAL] Number of Tables

2000-07-12 Thread Jackson Ching
Hi, Is there a limit in PostgreSQL 7.0.2 on how many number of tables can be created? Jack

[GENERAL] binary data ...

2000-07-12 Thread Gabriel López Millán
Hello all. I'm developer in Java with JDBC2.0. How can I stora a binary (byte []) (such a certificate X.509, request of certificate, etc). Can I use the Type String (I think that not)? Should I use LOB? Thanks a lot. Gabi.

Re: [GENERAL] Slashdot discussion

2000-07-12 Thread eschmid+sic
On Mon, Jul 10, 2000 at 08:40:27PM -0300, The Hermit Hacker wrote: > On Tue, 11 Jul 2000, Graeme Merrall wrote: > > > > > > Is anyone else noticing this: Everytime this sort of thing comes up a > > > number of people invariably tell that they are using MySQL because it's > > > easier to install,

[GENERAL] pgsql gives ExecutePlan error after empty UPDATE?

2000-07-12 Thread David C Mudie
Hello! I am using PostgreSQL 7.0.2 on FreeBSD 3.4. I am trying to update a table with the results of a (possibly empty) selection: zorro_4330=# create table foo(bar int4) \g CREATE zorro_4330=# update foo set bar = count(*) from foo \g ERROR: ExecutePlan: (junk) `ctid' is NULL! In

Re: [GENERAL] Re: [INTERFACES] Re: Link to postgesql components

2000-07-12 Thread Jeff Waugh
> Byron Nikolaidis wrote: > > How about links to all the other front-ends, like the odbc and jdbc drivers > for example? I know there are plenty more front-ends and useful things > that should appear in some kind of "links" section or something. > > This seems not so good to me. Is it that h

Re: [GENERAL] pgsql gives ExecutePlan error after empty UPDATE?

2000-07-12 Thread Tom Lane
David C Mudie <[EMAIL PROTECTED]> writes: > zorro_4330=# update foo set bar = count(*) from foo \g > ERROR: ExecutePlan: (junk) `ctid' is NULL! > Postgres seems to be reporting an error because the update matched no rows, > but this a perfectly legitimate database operation. Actually, it's

Re: [GENERAL] Re: [NOVICE] newbie problem on creating table

2000-07-12 Thread root
Tom Lane wrote: > > "Thomas Krebs" <[EMAIL PROTECTED]> writes: > > TRAP: Failed Assertion("!(((bool) (UserId != 0))):", File: "miscinit.c", > > Line: 446) > > I think what's causing this is that you can't use zero as a Postgres > userid. Unfortunately createuser doesn't enforce that restriction

Re: [GENERAL] Slashdot discussion

2000-07-12 Thread Lamar Owen
[EMAIL PROTECTED] wrote: > > huh? all i do is './configure;make;make install' ... > > And what about CVS? Have you changed the CVSROOT since it was changed between 7.0.0 and 7.0.2? My nightly CVS mirrors have worked perfectly for a long time -- that is, once I got the CVSROOT change properly d

[GENERAL] Sorry...

2000-07-12 Thread root
Ooops sorry. Now all options on this machine are now set properly. My email address is NOT [EMAIL PROTECTED] . It is [EMAIL PROTECTED] - Andreas Maus. -- @-@ | email: [EMAIL PROTECTED] | | http://www.bigfoot.com/~andreas_maus/ | @---

Re: [GENERAL] Sorry...

2000-07-12 Thread The Hermit Hacker
fixed On Wed, 12 Jul 2000, root wrote: > Ooops sorry. > Now all options on this machine are now set properly. > > My email address is NOT [EMAIL PROTECTED] . It is [EMAIL PROTECTED] > - > > Andreas Maus. > -- > @-@ > | email: [EMAIL PROTE

Re: [GENERAL] listen/notify

2000-07-12 Thread Tom Lane
"Tomas B. Winkler" <[EMAIL PROTECTED]> writes: > Could someone, please give me a little example on how to use listen/notify > mechanism. Or at least point me to some more legible documentation. > What I particulary need is that my frontend application is notified on > update/insert in a table. Ma

Re: [GENERAL] psql and Gnu readline

2000-07-12 Thread J.R. Belding
I had this same problem. Thanks to a suggestion from Bruce Momjian, I noticed that the configure script was not finding the readline libraries. I checked, and found that though I did have the readline package installed, I did not have the readline-devel package installed. Once I installed that

[GENERAL] psql \i

2000-07-12 Thread Richard Harvey Chapman
I have a text file of SQL commands which contains tabs. I used to be able to import it using psql using "\i file.sql". Now, I've upgraded to 7.0.2 and it treats the file as if I'm entering it all in manually. It treats the tabs as completion commands. CREATE TABLE alpha ( numSERIAL PRIMARY KEY

Re: [GENERAL] Re: [NOVICE] newbie problem on creating table

2000-07-12 Thread Peter Eisentraut
Tom Lane writes: > "Thomas Krebs" <[EMAIL PROTECTED]> writes: > > TRAP: Failed Assertion("!(((bool) (UserId != 0))):", File: "miscinit.c", > > Line: 446) > > I think what's causing this is that you can't use zero as a Postgres > userid. Unfortunately createuser doesn't enforce that restriction;

Re: [GENERAL] Re: [NOVICE] newbie problem on creating table

2000-07-12 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: TRAP: Failed Assertion("!(((bool) (UserId != 0))):", File: "miscinit.c", Line: 446) >> >> I think what's causing this is that you can't use zero as a Postgres >> userid. Unfortunately createuser doesn't enforce that restriction; >> I'll see

Re: [GENERAL] sql question

2000-07-12 Thread Ross J. Reedstrom
On Wed, Jul 12, 2000 at 05:33:09PM -0500, Travis Bauer wrote: > > Let's say I have a table t1 with two fields, x and y. How do I write an > sql statement like: > > select x if y>1 else 0 from t1; SELECT CASE WHEN y>1 THEN x ELSE 0 END FROM t1; >From page 33 of Bruce's book, at: http://www.po

Re: [GENERAL] Triggers with arguments

2000-07-12 Thread Richard Harvey Chapman
If I understand correctly, you have something like this: CREATE TABLE rec_* ( num integer primary key; other ... ); CREATE TABLE notes ( name CHAR(20), numINTEGER, note VARCHAR(200), PRIMARY KEY(name, num) ); So, you have many different tables like rec_*

Re: [GENERAL] Having a problem compiling plperl.

2000-07-12 Thread Tom Lane
"KMiller" <[EMAIL PROTECTED]> writes: > Having a problem compiling plperl. Try configuring with perl Makefile.PL POLLUTE=1 Known compatibility problem with newer perls ... regards, tom lane

[GENERAL] Figured it out (psql and Gnu readline)

2000-07-12 Thread Erich
With some helpful hints from various people, I figured out how to get this to work, and now my life is more pleasant and meaningful. Situation: Stock installation of OpenBSD 2.7, with PostgreSQL 7.0.2. I installed postgres by downloading the source tar and compiling, not by going through /usr/po

Re: [GENERAL] Figured it out (psql and Gnu readline)

2000-07-12 Thread Tom Lane
Erich <[EMAIL PROTECTED]> writes: > Following some sugestions on this group, I figured out the problem. > First, there is no history.h with readline 4.1. There's > readline/history.h. So I modified Makefile.global to include that > file. Also, I had to edit config.h, with several tweaks to vari

Re: [GENERAL] Triggers with arguments

2000-07-12 Thread Scott Holmes
What I'm after are triggers on delete fro several tables calling the same procedure. I am not at liberty to change the schema of the database as I need to accomodate what is actually an ancient system - that goes back before the days of blobs and large text fields. In my example, deleting a r

Re: [GENERAL] Figured it out (psql and Gnu readline)

2000-07-12 Thread Erich
> configure is supposed to handle all that for you ... if it failed to > find the right location of libreadline and associated includes then > the question is why. You sure you ran configure after installing > the include files? I just deleted my postgres tree, and then unpacked it again, and r

Re: [GENERAL] Triggers with arguments

2000-07-12 Thread Tom Lane
Scott Holmes <[EMAIL PROTECTED]> writes: > CREATE FUNCTION del_stxnoted () RETURNS opaque AS ' > DECLARE > fname alias for $1; > rkey alias for $2; > BEGIN > delete from stxnoted where filename = fname >and record_key = rkey; > END;' > LANGUAGE 'plpgsql'; > create trigg

Re: [GENERAL] Figured it out (psql and Gnu readline)

2000-07-12 Thread Tom Lane
Erich <[EMAIL PROTECTED]> writes: >> configure is supposed to handle all that for you ... if it failed to >> find the right location of libreadline and associated includes then >> the question is why. You sure you ran configure after installing >> the include files? > I just deleted my postgres

Re: [GENERAL] RE: [HACKERS] pg_dump & blobs - editable dump?

2000-07-12 Thread Philip Warner
At 07:58 13/07/00 +1000, Giles Lean wrote: > >I recommend you compress the whole stream, not the pieces. Presumably >you can determine the size of the pieces you're backing up, and ending >with a .tar.gz (or whatever) file is more convenient to manage than a >.tar file of compressed pieces unless

Re: [GENERAL] Figured it out (psql and Gnu readline)

2000-07-12 Thread Erich
> Well, that's darn peculiar. configure.in has a test for > readline/history.h, big as life: > AC_CHECK_HEADERS(readline/history.h) > Does the config.log file show why it failed to find the include? Here's the lines from config.log: configure:2539: checking for main in -lreadline configu

[GENERAL] How to get PL languages to work in Postgres

2000-07-12 Thread Erich
I'm sure this is a dumb question, but... When I try to create a PL/pgSQL function, even a very simple one like the add_one function in the example, I get this error: ERROR: Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'. Recognized languages are sql, C, internal and the crea

Re: [GENERAL] PostgreSQL and Access (via ODBC)

2000-07-12 Thread Froilan Mendoza
On Wed, 12 Jul 2000, Sean Weissensee wrote: > When importing in Access, it would have prompted you to select a unique > ID for each table, did you assign this ? Im pretty new to this, so please bear with me :) if unique id ~= create unique index myindex on table (field) then yes ... if not,

Re: [GENERAL] Figured it out (psql and Gnu readline)

2000-07-12 Thread Stephan Szabo
Here's a stupid question, What happens if you do the same kind of compile on a similar program from your shell (a simple program that includes , with and without -I/usr/local/include? I'm just wondering if the compiler is not looking in /usr/local/include by default and is not finding the header

Re: [GENERAL] Triggers with arguments

2000-07-12 Thread Robert B. Easter
On Wed, 12 Jul 2000, Scott Holmes wrote: > I'm afraid I just don't see how this is done without being able to pass > arguments to the procedure or actually running an additional SQL statement > within the trigger: > > I have a "notes" table that is potentially linked to records in many othe

[GENERAL] pgsql setup

2000-07-12 Thread Carsten Huettl
Hello, I am runing pgsql with suse linux v.6.4 I have installed pgsql with rpm. When I start initdb as user postgres I get the following error: /usr/lib/pgsql/bin/initdb: pg_id: command not found Unable to determine a valid username. If you are running initdb without an explicit username spec

[GENERAL] select for update not locking properly.

2000-07-12 Thread Joseph Shraibman
I have a program that does this: BEGIN; SELECT mystring FROM mytable WHERE x = 3 AND y = 4 FOR UPDATE; UPDATE mytable SET mystring = '' WHERE x = 3 AND y = 4; END; But the locking isn't working properly. I do something that should cause 3 different threads to try and do that append, and the fir

Re: [GENERAL] Re: How to list and remove a user in postgres ?

2000-07-12 Thread Prasanth A. Kumar
HomerWelch <[EMAIL PROTECTED]> writes: > Fred wrote: > > > > Hi, > > > > I am a newby and i dont understand how to list al the users or delete them ? > > > > 1 do i it from the command line in Linux > > 2 or in the database > > > > i have a user Fred and a user Grades and want delete them. >

Re: [GENERAL] select for update not locking properly.

2000-07-12 Thread Joseph Shraibman
And I forgot to mention my version is: PostgreSQL 7.0.1 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66 Joseph Shraibman wrote: > > I have a program that does this: > BEGIN; > SELECT mystring FROM mytable WHERE x = 3 AND y = 4 FOR UPDATE; > > UPDATE mytable SET mystring = '' WHERE x = 3 AN

[GENERAL] Getting closer with functions, but...

2000-07-12 Thread Scott Holmes
This function works but is not selective enough. The tg_argv[] are pointers to the arguments passed. And they do work correctly. CREATE FUNCTION del_stxnoted () RETURNS opaque AS ' declare fname text; rkey text; BEGIN fname := tg_argv[0]; rkey := ''old.'' || tg_argv[1]; dele

Re: [GENERAL] Getting closer with functions, but...

2000-07-12 Thread Tom Lane
Scott Holmes <[EMAIL PROTECTED]> writes: > Is there a syntax that will allow me to build an sql statement for use > in theis funcation (ie delete from stxnoted where filename = fname and > record_key = rkey). Not in plpgsql, because it wants to precompile the queries, so you can't determine tabl

[GENERAL] References on functions?

2000-07-12 Thread Erich
I'm starting to write functions in plpgsql, and I can do the basic stuff just fine, but the language isn't so well documented. Is there any good tutorial on the language? Or should I switch over to perl? I would rather learn plpgsql than do it in perl, because I would guess that plpgsql is fast

Re: [GENERAL] Getting closer with functions, but...

2000-07-12 Thread Philip Warner
At 20:58 12/07/00 -0700, Scott Holmes wrote: > >This function works but is not selective enough. The tg_argv[] are pointers >to the arguments passed. And they do work correctly. > ... > >Is there a syntax that will allow me to build an sql statement for use in >theis funcation (ie delete from