Re: [GENERAL] sequence advances on failed insert

2005-04-07 Thread Chris Smith
Yes, he meant that one should not assume that the next value will be one increment higher than the current highest value in the table. You shouldn't rely on them being sequential because they will not always be that way. Sven Willenberger wrote: David Fetter presumably uttered the following on

Re: [GENERAL] sequence advances on failed insert

2005-04-07 Thread Matthew Terenzio
On Apr 7, 2005, at 11:33 PM, David Fetter wrote: Relational purists sometimes insist that artificial keys cause more problems than they solve That's interesting. It seems to come in handy for me. It is interesting though. ---(end of broadcast)--- TIP

Re: [GENERAL] sequence advances on failed insert

2005-04-07 Thread David Fetter
On Thu, Apr 07, 2005 at 11:27:41PM -0400, Sven Willenberger wrote: > > > David Fetter presumably uttered the following on 04/07/05 20:16: > >On Thu, Apr 07, 2005 at 07:59:52PM -0400, Matthew Terenzio wrote: > > > >>I'm noticing that a sequence is advancing even if the insertion > >>fails. Is thi

Re: [GENERAL] sequence advances on failed insert

2005-04-07 Thread Sven Willenberger
David Fetter presumably uttered the following on 04/07/05 20:16: On Thu, Apr 07, 2005 at 07:59:52PM -0400, Matthew Terenzio wrote: I'm noticing that a sequence is advancing even if the insertion fails. Is this weird or expected? It's expected. Sequences are guaranteed to generate unique IDs. Th

[GENERAL] Can't install plpython on Windows 8.0

2005-04-07 Thread Steve - DND
I just tried using createlang to install plpython into a database on my Windows 8.0 installation and continue to receive the error below. The file plpython.dll is in exactly the location specified below as well. What exactly am I doing wrong here? createlang -e -U postgres plpythonu junk Password:

[GENERAL] DBD::Pg version 1.41 released

2005-04-07 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Version 1.41 of DBD::Pg, the PostgreSQL database driver for the DBI module, has been released. This version is primarily a bug fix for 1.40: if you are using that version (or less), you are highly encouraged to upgrade. COPY support has been overhaul

Re: [GENERAL] using limit with delete

2005-04-07 Thread Chris Smith
Hi Csaba, Because I have a where clause limiting which records I'm deleting. I'm deleting old info from a database, so I'm doing: DELETE FROM sessions WHERE EXISTS (SELECT sessiontime FROM sessions WHERE sessiontime < (timenow-7days) LIMIT 100) (timenow-7days is evaluated in PHP and made an int).

Re: [GENERAL] sequence advances on failed insert

2005-04-07 Thread David Fetter
On Thu, Apr 07, 2005 at 07:59:52PM -0400, Matthew Terenzio wrote: > I'm noticing that a sequence is advancing even if the insertion > fails. Is this weird or expected? It's expected. Sequences are guaranteed to generate unique IDs. These happen to be an increasing sequence of integers, but there

[GENERAL] sequence advances on failed insert

2005-04-07 Thread Matthew Terenzio
I'm noticing that a sequence is advancing even if the insertion fails. Is this weird or expected? Matt Terenzio ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] Iterate OLD/NEW columns in a trigger?

2005-04-07 Thread Steve - DND
> > try pltcl, it's supposed to be pretty good at this. > > > > As is plperl and likely plpython, and maybe others. Does anyone have an example of this at work? I tried a few Google searches, but couldn't get any results showing iterating over the columns of a record. Thanks, Steve ---

Re: [GENERAL] Iterate OLD/NEW columns in a trigger?

2005-04-07 Thread Sean Davis
On Apr 7, 2005, at 3:44 PM, Scott Marlowe wrote: On Thu, 2005-04-07 at 14:35, Steve - DND wrote: Is there a way to iterate the columns contained on the OLD/NEW. I want to do some work in a function in a trigger, but I want it to be generic. I don't want to have to create a separate trigger for ea

Re: [GENERAL] Iterate OLD/NEW columns in a trigger?

2005-04-07 Thread Scott Marlowe
On Thu, 2005-04-07 at 14:35, Steve - DND wrote: > Is there a way to iterate the columns contained on the OLD/NEW. I want to do > some work in a function in a trigger, but I want it to be generic. I don't > want to have to create a separate trigger for each table, since the work > performed in the t

[GENERAL] Iterate OLD/NEW columns in a trigger?

2005-04-07 Thread Steve - DND
Is there a way to iterate the columns contained on the OLD/NEW. I want to do some work in a function in a trigger, but I want it to be generic. I don't want to have to create a separate trigger for each table, since the work performed in the trigger is essentially the same for all of them. I just n

Re: [GENERAL] seg fault with tsearch2

2005-04-07 Thread Tom Lane
Joel Leyh <[EMAIL PROTECTED]> writes: > Ah ok. I must have copied it incorectly. I am using 8.0.1 from the > latest binary build from NetBSD. The source I used was > postgresql-8.0.1.tar.bz2 stable release. Hmm. I found I still had an older copy of tsearch2 on my other machine, but I couldn't dup

Re: [GENERAL] seg fault with tsearch2

2005-04-07 Thread Joel Leyh
Ah ok. I must have copied it incorectly. I am using 8.0.1 from the latest binary build from NetBSD. The source I used was postgresql-8.0.1.tar.bz2 stable release. I will try the CVS release to see if it's fixed. --Joel On Apr 7, 2005 12:26 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > Joel Leyh <[EMAI

Re: [GENERAL] seg fault with tsearch2

2005-04-07 Thread Tom Lane
Joel Leyh <[EMAIL PROTECTED]> writes: > insert into server_file values (default,'511','/test/20-Shania > Twain-Party For Two with Billy > Curringtonmp3','mp3','323',default,'1'); I get ERROR: null value in column "server_file_size" violates not-null constraint which I think indicates you mistran

[GENERAL] seg fault with tsearch2

2005-04-07 Thread Joel Leyh
I have Pg installed on i386 NetBSD from the NetBSD package manager. I then installed tsearch2 and used its default installation. I then also got the source and built from it, with debugging enabled. Again I installed tsearch2 but my results were the same. Created a new database, added a table with

Re: [GENERAL] Improvement for COPY command .. unless it already exists

2005-04-07 Thread Sean Davis
On Apr 7, 2005, at 10:33 AM, David Gagnon wrote: Hi, I want to default some columns for this COPY command only. So DEFAULT is not appropriate in this case. In fact I think you suggested a workaround right ? Doing an alter table before and another one after will work ... not fully clean though

Re: [GENERAL] WAL on a RAM disk

2005-04-07 Thread Stephen Frost
* David Parker ([EMAIL PROTECTED]) wrote: > As part of our application we are running a postgres server on a RAM > disk. All of the data stored in this database is obviously disposable, > and we need to optimize access as much as possible. This is on Solaris > 9/intel, postgres 7.4.5. Some things I

Re: [GENERAL] WAL on a RAM disk

2005-04-07 Thread Joshua D. Drake
David Parker wrote: As part of our application we are running a postgres server on a RAM disk. All of the data stored in this database is obviously disposable, and we need to optimize access as much as possible. This is on Solaris 9/intel, postgres 7.4.5. Some things I'm wondering about: 1) is

[GENERAL] WAL on a RAM disk

2005-04-07 Thread David Parker
As part of our application we are running a postgres server on a RAM disk. All of the data stored in this database is obviously disposable, and we need to optimize access as much as possible. This is on Solaris 9/intel, postgres 7.4.5. Some things I'm wondering about:   1) is it possible to

Re: [GENERAL] Improvement for COPY command .. unless it already exists

2005-04-07 Thread David Gagnon
Hi, I want to default some columns for this COPY command only. So DEFAULT is not appropriate in this case. In fact I think you suggested a workaround right ? Doing an alter table before and another one after will work ... not fully clean thought since my user may not have the write to modify

Re: [GENERAL] Improvement for COPY command .. unless it already exists (If yes please tell me!)

2005-04-07 Thread Tom Lane
David Gagnon <[EMAIL PROTECTED]> writes: > Is there a way to specify default values in the COPY command? There's always ALTER TABLE ... SET DEFAULT. regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our exte

Re: [GENERAL] lower function

2005-04-07 Thread Mage
Scott Marlowe wrote: > >You're far more likely to learn tcl or python or php in an afternoon >than to get a patched perl executable in that time. > >But I'd still report the bug to them. > > create or replace function keywords_split(text) returns text as $$ use locale; use POSIX qw(local

[GENERAL] Improvement for COPY command .. unless it already exists (If yes please tell me!)

2005-04-07 Thread David Gagnon
Hi all, Thanks for your reply on my yesterday's question regarding UTF-8 as a UNICODE implementation in postgresql. Is there a way to specify default values in the COPY command? In my example example VDVSSRC and VDVSNUM are the same for the 150 rows of the file. If it was possible to def

Re: [GENERAL] using limit with delete

2005-04-07 Thread Csaba Nagy
Hi Chris, Just a thought: if you have to clear the table anyway, wouldn't it work for you to use truncate ? That should be faster than delete. HTH, Csaba. On Thu, 2005-04-07 at 04:11, Chris Smith wrote: > I don't care about the order in my particular case, just that I have to > clear the table.