[GENERAL] any way for ORDER BY x to imply NULLS FIRST in 8.3?

2007-11-05 Thread rihad
Is there any way to "hardcode" the NULL handling in an index (as per http://www.postgresql.org/docs/8.3/static/indexes-ordering.html) so that SELECT * FROM t ORDER BY foo automatically implies NULLS FIRST (and, similarly so that SELECT * FROM t ORDER BY foo DESC automatically implies NULLS LAS

Re: [GENERAL] for libpq which include defines the type oids

2007-11-05 Thread Pavel Stehule
On 06/11/2007, Samantha Atkins <[EMAIL PROTECTED]> wrote: > I am probably overlooking something but where exactly are these found > for inclusion is libpq based programs? Poking around my installation > doesn't make it obvious. > > - samantha > > Get oids dynamically. Use static oids on client par

[GENERAL] for libpq which include defines the type oids

2007-11-05 Thread Samantha Atkins
I am probably overlooking something but where exactly are these found for inclusion is libpq based programs? Poking around my installation doesn't make it obvious. - samantha ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, p

[GENERAL] safely increase a single column integer value

2007-11-05 Thread Anton Andreev
Hi, What is the best way from concurrency point of view to increase a integer value from a table? Suppose you count every postback from all the users that are currently browsing your web-site. Cheers, Anton ---(end of broadcast)--- TIP 9: In

Re: [GENERAL] php and postgres - too many queries too fast?

2007-11-05 Thread Tom Hart
andy wrote: Tom Hart wrote: [snip] OK, enough of the background, here's my issue. For some lovely reason, even though my script reports running an UPDATE query 1563 times (out of 1566 rows), only 316 rows have is_ok set to TRUE. I've tried a few times, changing this and that, and it always upd

Re: [GENERAL] php and postgres - too many queries too fast?

2007-11-05 Thread Jeff Davis
On Mon, 2007-11-05 at 17:18 -0500, Tom Hart wrote: > UPDATE table SET is_ok = 'TRUE' WHERE var1 = value1 AND var2 = value2 > AND var3 = value3. As others have said, you need to narrow the problem down a bit more before we can provide useful help. However, a wild guess might be that some of y

Re: [GENERAL] How to temporarily disable a table's FK constraints?

2007-11-05 Thread andy
Kynn Jones wrote: Hi, everyone. Is there a standard way to disable a table foreign-key constraint temporarily? I thought that this would be a fairly common thing to want to do, but I only found this snippet online: -- to disable UPDATE pg_class SET reltriggers=0 WHERE relname = 'your_table';

Re: [GENERAL] php and postgres - too many queries too fast?

2007-11-05 Thread andy
Tom Hart wrote: [snip] OK, enough of the background, here's my issue. For some lovely reason, even though my script reports running an UPDATE query 1563 times (out of 1566 rows), only 316 rows have is_ok set to TRUE. I've tried a few times, changing this and that, and it always updates those 31

Re: [GENERAL] php and postgres - too many queries too fast?

2007-11-05 Thread Scott Marlowe
On 11/5/07, Tom Hart <[EMAIL PROTECTED]> wrote: > Hey everybody. I'm running postgresql 8.2 on a windows 2k3 server > machine. I have a table (two tables actually, in table and table_import > format). The _import table has all text type fields, while the main > table has datatypes defined. > > I wr

[GENERAL] php and postgres - too many queries too fast?

2007-11-05 Thread Tom Hart
Hey everybody. I'm running postgresql 8.2 on a windows 2k3 server machine. I have a table (two tables actually, in table and table_import format). The _import table has all text type fields, while the main table has datatypes defined. I wrote a PHP script that checks the various type fields (e

Re: [GENERAL] How to transfer from place to plase without backup/restore

2007-11-05 Thread Alvaro Herrera
Hristo Filipov wrote: > Is there a way to tell PostgreSQL not install itself with OS or/and CPU > compatibility(for the prize of loosing performance), but that way the one > can move files free from on Computer to another? No, there isn't. -- Alvaro Herrera http://

[GENERAL] Locale and indexes: howto?

2007-11-05 Thread Reg Me Please
HI all. While reading chapter 11 of v8.2 I've encountered this sentence: However, if your server does not use the C locale you will need to create the index with a special operator class to support indexing of pattern-matching queries. Well, I'd like to use the C locale at least for PGSQL. Accor

Re: [GENERAL] Is there a way to tell how far along a COPY is in the process?

2007-11-05 Thread andy
Keaton Adams wrote: I’m looking for a way to see how many rows have been processed while a COPY is actually running. I can’t seem to find a pg_stat table/view that will give me this level of visibility into the process. Is there any way to do this, to tell the number of rows processed durin

Re: [GENERAL] Filter sequence

2007-11-05 Thread Tom Lane
=?ISO-8859-1?Q?Andr=E9_Volpato?= <[EMAIL PROTECTED]> writes: > select u2.cod, u2.name > from > ( > select u.cod, u.name > from users u > where age between 0 and 44 and sex='F' > group by u.cod, u.name > ) u2 > group by u2.cod, u2.name > having > getSalaryPeriod(1997,1999,u2.cod)

Re: [GENERAL] Is there a way to tell how far along a COPY is in the process?

2007-11-05 Thread Erik Jones
On Nov 5, 2007, at 1:32 PM, Keaton Adams wrote: I’m looking for a way to see how many rows have been processed while a COPY is actually running. I can’t seem to find a pg_stat table/view that will give me this level of visibility into the process. Is there any way to do this, to tell t

Re: [GENERAL] running postgresql

2007-11-05 Thread Tom Lane
Charles <[EMAIL PROTECTED]> writes: > I am running Gutsy (Ubuntu 7.10) and new to Postgresql. I followed the > direction at https://help.ubuntu.com/community/PostgreSQL. I executed > the following commands: > sudo -u postgres createuser -D -A -P myuser > sudo -u postgres createdb -O myu

Re: [GENERAL] running postgresql

2007-11-05 Thread Erik Jones
On Nov 5, 2007, at 12:36 PM, Charles wrote: I am running Gutsy (Ubuntu 7.10) and new to Postgresql. I followed the direction at https://help.ubuntu.com/community/PostgreSQL. I executed the following commands: sudo -u postgres createuser -D -A -P myuser sudo -u postgres createdb -

Re: [GENERAL] running postgresql

2007-11-05 Thread Scott Ribe
Well it defaults to mapping to the current user, so you would have wanted: psql -U myuser mydb Or just create a postgres user named dagon and create the db as owned by that user. Or su myuser before running psql... -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice

[GENERAL] Filter sequence

2007-11-05 Thread André Volpato
Hi all, I´m experiencing an unexpected behaviour in the planner. I want the planner to apply a function in the results of a subquery, but its doing a filter in the hole table. The results between the mixed filters are the same in the end, but its taking ages. What I want is the planner to apll

[GENERAL] Is there a way to tell how far along a COPY is in the process?

2007-11-05 Thread Keaton Adams
I¹m looking for a way to see how many rows have been processed while a COPY is actually running. I can¹t seem to find a pg_stat table/view that will give me this level of visibility into the process. Is there any way to do this, to tell the number of rows processed during a COPY into a table whi

Re: [GENERAL] How to temporarily disable a table's FK constraints?

2007-11-05 Thread Kynn Jones
On 11/5/07, Erik Jones <[EMAIL PROTECTED]> wrote: > ...see about redefining the foreign key > as being deferrable... Yep, that'll do it. Thanks! kj ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.pos

Re: [GENERAL] How to temporarily disable a table's FK constraints?

2007-11-05 Thread Sam Mason
On Mon, Nov 05, 2007 at 01:52:54PM -0400, Kynn Jones wrote: > BTW, I realize that I can just drop and reinstate constraints, but > from the point of view of writing a Perl script to do all this, it > would be much easier if I could just disable temporarily all the FK > constraints on a table. Do y

[GENERAL] running postgresql

2007-11-05 Thread Charles
I am running Gutsy (Ubuntu 7.10) and new to Postgresql. I followed the direction at https://help.ubuntu.com/community/PostgreSQL. I executed the following commands: sudo -u postgres createuser -D -A -P myuser sudo -u postgres createdb -O myuser mydb [EMAIL PROTECTED]:~$ psql

Re: [GENERAL] How to temporarily disable a table's FK constraints?

2007-11-05 Thread Erik Jones
On Nov 5, 2007, at 11:52 AM, Kynn Jones wrote: On 11/5/07, Erik Jones <[EMAIL PROTECTED]> wrote: On Nov 5, 2007, at 10:50 AM, Kynn Jones wrote: Is there a standard way to disable a table foreign-key constraint temporarily? I thought that this would be a fairly common thing to want to do...

Re: [GENERAL] How to temporarily disable a table's FK constraints?

2007-11-05 Thread Scott Marlowe
On 11/5/07, Kynn Jones <[EMAIL PROTECTED]> wrote: > On 11/5/07, Erik Jones <[EMAIL PROTECTED]> wrote: > > > On Nov 5, 2007, at 10:50 AM, Kynn Jones wrote: > > > Is there a standard way to disable a table foreign-key constraint > > > temporarily? > > > > > > I thought that this would be a fairly com

Re: [GENERAL] Problems with PostgreSQL DBI-Link / DBD-ODBC

2007-11-05 Thread David Fetter
On Mon, Nov 05, 2007 at 05:02:03PM +0100, Pit M. wrote: > Hi David, > > I'm sorry to bother you again, but I still couldn't get it to work. > Like you suggested, I checked for successfully installed schemas. > There was one, which I deleted again because I don't know which of > my countless tries

Re: [GENERAL] How to temporarily disable a table's FK constraints?

2007-11-05 Thread Kynn Jones
On 11/5/07, Erik Jones <[EMAIL PROTECTED]> wrote: > On Nov 5, 2007, at 10:50 AM, Kynn Jones wrote: > > Is there a standard way to disable a table foreign-key constraint > > temporarily? > > > > I thought that this would be a fairly common thing to want to do... > Can you explain what it is you're

[GENERAL] Bitemporal sequenced unique constraint (function/trigger)

2007-11-05 Thread Keith Carr
Hi there, This is my first time posting in here and I'm hoping somebody can point out where I am going wrong? I am currently trying to use Bitemporal tables. By this I mean a table with a valid times and transaction times. These topics are covered by Joe Celko and Richard Snodgrass in their res

Re: [GENERAL] How to temporarily disable a table's FK constraints?

2007-11-05 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/05/07 10:50, Kynn Jones wrote: > Hi, everyone. > > Is there a standard way to disable a table foreign-key constraint temporarily? > > I thought that this would be a fairly common thing to want to do, but > I only found this snippet online: > >

Re: [GENERAL] How to temporarily disable a table's FK constraints?

2007-11-05 Thread Erik Jones
On Nov 5, 2007, at 10:50 AM, Kynn Jones wrote: Hi, everyone. Is there a standard way to disable a table foreign-key constraint temporarily? I thought that this would be a fairly common thing to want to do, but I only found this snippet online: -- to disable UPDATE pg_class SET reltriggers=

Re: [GENERAL] Restore a database

2007-11-05 Thread Martijn van Oosterhout
On Sun, Nov 04, 2007 at 03:52:51PM -0500, Jesus Arocho wrote: > Ok, I committed the worst mistake in db admin. I upgraded to 8.1 on my > debian > server but forgot to backup one of the databases. The 7.1 directory is still > there. I would like a list of options. I am not sure that temporari

Re: [GENERAL] Restore a database

2007-11-05 Thread Martijn van Oosterhout
On Sun, Nov 04, 2007 at 03:52:51PM -0500, Jesus Arocho wrote: > Ok, I committed the worst mistake in db admin. I upgraded to 8.1 on my > debian > server but forgot to backup one of the databases. The 7.1 directory is still > there. I would like a list of options. I am not sure that temporari

[GENERAL] How to temporarily disable a table's FK constraints?

2007-11-05 Thread Kynn Jones
Hi, everyone. Is there a standard way to disable a table foreign-key constraint temporarily? I thought that this would be a fairly common thing to want to do, but I only found this snippet online: -- to disable UPDATE pg_class SET reltriggers=0 WHERE relname = 'your_table'; -- to re-enable UPDA

Re: [GENERAL] COPY ... FROM and index usage

2007-11-05 Thread Lincoln Yeoh
Hi, Anyone have comparisons/benchmarks to give some idea of the potential performance gains? Say compared to doing the stuff here: http://www.postgresql.org/docs/8.2/static/populate.html Regards, Link. At 09:35 AM 11/5/2007, Toru SHIMOGAKI wrote: Dimitri, thank you for your quoting. I'm a p

Re: [GENERAL] Problems with PostgreSQL DBI-Link / DBD-ODBC

2007-11-05 Thread Pit M.
Hi David, I'm sorry to bother you again, but I still couldn't get it to work. Like you suggested, I checked for successfully installed schemas. There was one, which I deleted again because I don't know which of my countless tries to create it was the successful one. I think the following code

Re: [GENERAL] Copy the database..

2007-11-05 Thread Rainer Bauer
Tom Lane wrote: >Rainer Bauer <[EMAIL PROTECTED]> writes: >> Wouldn't it be possible to copy the database folder and somehow instruct the >> postmaster to include the copied data after a restart? > >See CREATE DATABASE's TEMPLATE option. It's a bit crude but I think >it'll help. Thanks, Tom. Wor

Re: [GENERAL] Populating large DB from Perl script

2007-11-05 Thread Rodrigo De León
On 11/3/07, Mikko Partio <[EMAIL PROTECTED]> wrote: > On Nov 2, 2007 8:45 PM, Kynn Jones <[EMAIL PROTECTED]> wrote: > It would be great if there was a stored proc-archive somewhere in the > web where people could post their procedures. I know there are some > code examples in the official documenta

Re: [GENERAL] Would an index benefit select ... order by?

2007-11-05 Thread Sam Mason
On Mon, Nov 05, 2007 at 10:09:12AM +0400, rihad wrote: > What if it's really a limited select: > > select * from foo order by created_at desc limit ; > > because this is what I meant initially (sorry), would Postgres always > use index to get at sorted created_at values, so I don't *have* to >