[GENERAL] RE: [GENERAL] ‘--pwfile’ command

2007-11-07 Thread Albe Laurenz
Tommy Flewwelling wrote: Could someone tell me if the ‘--pwfile’ command can be applied to createdb.exe and psql.exe? No, but you can use the libpq password file. See http://www.postgresql.org/docs/current/static/libpq-pgpass.html Yours, Laurenz Albe ---(end of

Re: [GENERAL] Syntax error in a large COPY

2007-11-07 Thread Reg Me Please
Il Wednesday 07 November 2007 07:54:41 Reg Me Please ha scritto: Il Wednesday 07 November 2007 01:29:44 Alvaro Herrera ha scritto: Reg Me Please wrote: Il Tuesday 06 November 2007 22:13:15 hai scritto: That's the branch and bound. Editing 29M+ lines file takes some time. But this is

Re: [GENERAL] Syntax error in a large COPY

2007-11-07 Thread Reg Me Please
Il Wednesday 07 November 2007 11:10:40 Dimitri Fontaine ha scritto: Le mercredi 07 novembre 2007, Reg Me Please a écrit : pgloader seems not that easy to use for a newbie like myself. Also because domentation seems too skinny. Sorry about this, writting documentation in English is not that

Re: [GENERAL] Syntax error in a large COPY

2007-11-07 Thread Dimitri Fontaine
Le mercredi 07 novembre 2007, Reg Me Please a écrit : pgloader seems not that easy to use for a newbie like myself. Also because domentation seems too skinny. Sorry about this, writting documentation in English is not that easy when it's not one's natural language... I'll accept any

Re: [GENERAL] Syntax error in a large COPY

2007-11-07 Thread Reg Me Please
Il Wednesday 07 November 2007 11:26:56 Dimitri Fontaine ha scritto: Le mercredi 07 novembre 2007, Reg Me Please a écrit : Maybe just a complete example would suffice. Let's say a table structure, a CSV and a raw text file, a config file and the run output. Do you mean something like the

Re: [GENERAL] Syntax error in a large COPY

2007-11-07 Thread Dimitri Fontaine
Le mercredi 07 novembre 2007, Reg Me Please a écrit : Maybe just a complete example would suffice. Let's say a table structure, a CSV and a raw text file, a config file and the run output. Do you mean something like the included examples, which I tend to also use as (regression) tests?

[GENERAL] number errors

2007-11-07 Thread João Paulo Zavanela
Hi all, When my application returns errors from database, some numbers errors is equals. Why number errors is equals? odbc driver or postgresql return this? It's run in Windows. Thanks. ---(end of broadcast)--- TIP 5: don't forget to increase

Re: [GENERAL] Syntax error in a large COPY

2007-11-07 Thread Reg Me Please
Il Tuesday 06 November 2007 19:05:52 Reg Me Please ha scritto: Hi all. I'm generating an SQL script to load some million rows into a table. I'm trying to use the COPY command in order to speed the load up. At a certain point I get an error telling about a invalid input syntax for type

Re: [GENERAL] Postgresql simple query performance question

2007-11-07 Thread André Volpato
Reid Thompson escreveu: On Tue, 2007-11-06 at 14:39 -0300, André Volpato wrote: Remember that you can always use serial fields to count a table, like: alter table foo add id serial; select id from foo order by id desc limit 1; This should return the same value than count(*), in

Re: [GENERAL] Postgresql simple query performance question

2007-11-07 Thread Reg Me Please
Il Wednesday 07 November 2007 13:08:46 André Volpato ha scritto: !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head meta content=text/html;charset=UTF-8 http-equiv=Content-Type title/title /head body bgcolor=#ff text=#00 Reid Thompson escreveu: Would it be

Re: [GENERAL] Syntax error in a large COPY

2007-11-07 Thread Dimitri Fontaine
Le mercredi 07 novembre 2007, Reg Me Please a écrit : I installed .deb. The man page has not been included. It seems the latter package on pgfoundry does have a problem here. As I have some patches waiting for a release, I'll make current CVS the 2.2.2 version and update the pgfoundry files

Re: [GENERAL] Postgresql simple query performance question

2007-11-07 Thread Simon Riggs
On Tue, 2007-11-06 at 09:29 -0500, Bill Moran wrote: In response to SHARMILA JOTHIRAJAH [EMAIL PROTECTED]: Hi We are in the process of testing for migration of our database from Oracle to Postgresql. I hava a simple query Select count(*) from foo This is asked a lot. The quick

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

2007-11-07 Thread Simon Riggs
On Tue, 2007-11-06 at 09:48 -0500, Tom Lane wrote: Essentially the same text appears in SQL2003. Any application that depends on one particular choice here is therefore broken, or at least has chosen to work with only about half of the DBMSes in the world. If an application has already made

Re: [GENERAL] number errors

2007-11-07 Thread Andrei Kovalevski
Hello, If you use ODBC - you should devide error from ODBC driver and errors from PostgreSQL, ODBC driver return it's own error codes, and composes error Description depending on Error Code and Text from PostgreSQL server. So you should have numbers: 1) ODBC error code - described in MSDN;

[GENERAL] prepared statements suboptimal?

2007-11-07 Thread rihad
Hi, I'm planning to use prepared statements of indefinite lifetime in a daemon that will execute same statements rather frequently in reply to client requests. This link: http://www.postgresql.org/docs/8.3/static/sql-prepare.html has a note on performance: In some situations, the query plan

Re: [GENERAL] (Never?) Kill Postmaster?

2007-11-07 Thread Alvaro Herrera
Christian Schröder wrote: Alvaro Herrera wrote: Please try thread apply all bt full on gdb. The first lines where the symbols are loaded are of course identical. The output of the command is in my opinion not very helpful: I was actually hoping that it would list the running threads in

Re: [GENERAL] prepared statements suboptimal?

2007-11-07 Thread Reg Me Please
Il Wednesday 07 November 2007 12:25:46 rihad ha scritto: I don't understand why postgres couldn't plan this: SELECT foo.e, foo.f FROM foo WHERE pk=$1 AND b=$2 AND status='1' AND c = $3; to be later executed any slower than SELECT foo.e, foo.f FROM foo WHERE pk='abcabc' AND b='13' AND

Re: [GENERAL] Exclusive Locks Taken on User Tables?

2007-11-07 Thread Simon Riggs
On Tue, 2007-11-06 at 15:53 -0500, Marc wrote: Ok. I'll keep looking at pg_locks. My original reason for reaching out to the list was over confusion as to when an EXCLUSIVE lock would be taken table level since the documentation says this should never happen except to some system

Re: [GENERAL] prepared statements suboptimal?

2007-11-07 Thread rihad
rihad wrote: Hi, I'm planning to use prepared statements of indefinite lifetime in a daemon that will execute same statements rather frequently in reply to client requests. This link: http://www.postgresql.org/docs/8.3/static/sql-prepare.html has a note on performance: In some situations,

Re: [GENERAL] strange timezone problem

2007-11-07 Thread Tom Lane
Nick Johnson [EMAIL PROTECTED] writes: I'm using PostgreSQL 8.2.3 and seeing this behaviour with timezones: select create_date from article_lead; create_date --- 2007-11-04 16:35:33.17+00 2007-11-04 04:35:36.09+00 2007-11-05 04:35:36.38+00 2007-11-05

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

2007-11-07 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: Simon Riggs [EMAIL PROTECTED] writes: Perhaps we can have a parameter? default_null_sorting = 'last' # may alternatively be set to 'first' Not unless it's locked down at initdb time. Otherwise flipping the value bars you from using every existing index

Re: [GENERAL] The .pgpass file

2007-11-07 Thread Alvaro Herrera
Tommy Flewwelling wrote: Hello, How do I specify in the command-line to access the .pgpass file when creating a database? You don't. If the file exists and has the correct permission, createdb will read it. If the needed password is found, the connection will be done without ever

Re: [GENERAL] Temporary, In-memory Postgres DB?

2007-11-07 Thread Scott Marlowe
On 11/7/07, Gauthier, Dave [EMAIL PROTECTED] wrote: Yes, I'm thinking of a small DB (could fit into mem). And the notion that all the data would reside in memory makes sense. But what about the metadata? And there is the question of the initdb and all the stuff it creates. That goes to

Re: [GENERAL] Syntax error in a large COPY

2007-11-07 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/07 11:35, Andrej Ricnik-Bay wrote: On 11/8/07, Collin Kidder [EMAIL PROTECTED] wrote: [snip] No, just not everyone agrees with your viewpoint on this topic. Top posting has it's place and some of us prefer it. But they could just

Re: DB on a ramdisk (was Re: [GENERAL] Temporary, In-memory Postgres DB?)

2007-11-07 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Undo an initdb? Probably the same way you undo unlinking an SQLite database. Maybe being wrapped in my own little niche I just don't know enough about the wide world of hyperfeaturitis, but making temporary DB as a feature seems a little vague. It

Re: [GENERAL] Syntax error in a large COPY

2007-11-07 Thread Steve Wampler
Collin Kidder wrote: I'm with Thomas. I think that, while inline posting is a good thing, bottom posting is dead stupid and wastes my time. It is far easier to follow a thread with top posting as the relevant text is right there at the top ready to be read. That sounds more like an argument

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

2007-11-07 Thread Simon Riggs
On Wed, 2007-11-07 at 11:39 -0500, Tom Lane wrote: Simon Riggs [EMAIL PROTECTED] writes: On Wed, 2007-11-07 at 10:23 -0500, Tom Lane wrote: I put this in the same category as altering the identifier case-folding rules. That has much less effect on application portability, Really?

Re: [GENERAL] strange timezone problem

2007-11-07 Thread andy
Nick Johnson wrote: Before I open a bug on this, I wanted to do a sanity check, since there may be something I'm just not seeing. I'm using PostgreSQL 8.2.3 and seeing this behaviour with timezones: select create_date from article_lead; create_date ---

Re: [GENERAL] Syntax error in a large COPY

2007-11-07 Thread Collin Kidder
My point is: with top-posting I don't care how many lines were repeated because I don't have to scroll. Considering there is an RFC that recommends inline posting over top-posting (http://tools.ietf.org/html/rfc1855), and considering the fact that this topic has been beat to death on

Re: [GENERAL] prepared statements suboptimal?

2007-11-07 Thread Tom Lane
rihad [EMAIL PROTECTED] writes: Aha, thanks for a thorough explanation. Now I understand that while looking for a way to fulfill the query postgres will try hard to pick the one requiring the least number of rows visits. I've skimmed over my queries: almost all of them make use of the

[GENERAL] strange timezone problem

2007-11-07 Thread Nick Johnson
Before I open a bug on this, I wanted to do a sanity check, since there may be something I'm just not seeing. I'm using PostgreSQL 8.2.3 and seeing this behaviour with timezones: select create_date from article_lead; create_date --- 2007-11-04 16:35:33.17+00

DB on a ramdisk (was Re: [GENERAL] Temporary, In-memory Postgres DB?)

2007-11-07 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/07 09:58, Tom Lane wrote: Ron Johnson [EMAIL PROTECTED] writes: On 11/07/07 09:03, Gauthier, Dave wrote: Is there such a thing as a temporary, probably in-memory, version of a Postgres DB? If you have enough RAM, and your database is

Re: [GENERAL] The .pgpass file

2007-11-07 Thread Peter Eisentraut
Am Mittwoch, 7. November 2007 schrieb Tommy Flewwelling: How do I inform the complier to extract the password from the file and not the prompt the user? It does that automatically. Just omit the -W option. -- Peter Eisentraut http://developer.postgresql.org/~petere/

Re: [GENERAL] md5() sorting

2007-11-07 Thread Marko Kreen
On 11/7/07, Karsten Hilbert [EMAIL PROTECTED] wrote: On Wed, Nov 07, 2007 at 03:54:02PM +0100, Martijn van Oosterhout wrote: Should I be going about this sorting or hashing or detection business in another way entirely which can be done at the SQL level ? I'm wondering if you cast

Re: [GENERAL] The .pgpass file

2007-11-07 Thread Tom Lane
Tommy Flewwelling [EMAIL PROTECTED] writes: How do I specify in the command-line to access the .pgpass file when creating a database? Huh? You don't specify anything, it's done automatically when needed. I don’t want to have to include (-W): C:\postgressql\bincreatedb -U postgres –p 5432

Re: [GENERAL] Temporary, In-memory Postgres DB?

2007-11-07 Thread Tom Lane
Ron Johnson [EMAIL PROTECTED] writes: On 11/07/07 09:03, Gauthier, Dave wrote: Is there such a thing as a temporary, probably in-memory, version of a Postgres DB? If you have enough RAM, and your database is small enough, the OS will eventually cache the whole thing. Or put it on a ramdisk

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

2007-11-07 Thread Simon Riggs
On Wed, 2007-11-07 at 16:05 +0100, Martijn van Oosterhout wrote: On Wed, Nov 07, 2007 at 02:37:41PM +, Simon Riggs wrote: Editing an application, you would be required to add the words NULLS FIRST to every single ORDER BY and every single CREATE INDEX in an application. If we know that

Re: [GENERAL] odbcng

2007-11-07 Thread Andrei Kovalevski
Hello, This query works for me on Access 2003. Which versions of Access and ODBCng you have? We can communicate via [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]. I'll try to help you with any problems. Sam Mason wrote: On Tue, Nov 06, 2007 at 05:48:12PM -0300, Alvaro Herrera wrote: FYI

[GENERAL] Temporary, In-memory Postgres DB?

2007-11-07 Thread Gauthier, Dave
This is a real longshot, but here goes... Is there such a thing as a temporary, probably in-memory, version of a Postgres DB? Sort of like SQLite, only with the features/function of PG? A DB like this would exist inside of, and for the duration of, a script/program that created it, then

[GENERAL] The .pgpass file

2007-11-07 Thread Tommy Flewwelling
Hello, How do I specify in the command-line to access the .pgpass file when creating a database? I would like to use ~/.pgpass instead of –W on the command line when creating a database (createdb) and was wondering the correct syntax. For example, I don’t want to have to include

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

2007-11-07 Thread Martijn van Oosterhout
On Wed, Nov 07, 2007 at 02:37:41PM +, Simon Riggs wrote: Editing an application, you would be required to add the words NULLS FIRST to every single ORDER BY and every single CREATE INDEX in an application. If we know that is what people would do, why not have one parameter to do this for

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

2007-11-07 Thread Simon Riggs
On Wed, 2007-11-07 at 08:38 -0500, Bruce Momjian wrote: Simon Riggs wrote: If an application has already made that choice then we should allow them the opportunity to work with PostgreSQL. The application may be at fault, but PostgreSQL is the loser because of that decision. The SQL

Re: [GENERAL] prepared statements suboptimal?

2007-11-07 Thread Tom Lane
rihad [EMAIL PROTECTED] writes: I don't understand why postgres couldn't plan this: SELECT foo.e, foo.f FROM foo WHERE pk=$1 AND b=$2 AND status='1' AND c = $3; to be later executed any slower than SELECT foo.e, foo.f FROM foo WHERE pk='abcabc' AND b='13' AND status='1' AND c =

Re: [GENERAL] Npsql is much faster than ODBC ?

2007-11-07 Thread Rainer Bauer
Alvaro Herrera wrote: Rainer Bauer wrote: Andrej Ricnik-Bay wrote: On Nov 7, 2007 2:40 PM, Rainer Bauer [EMAIL PROTECTED] wrote: That's nice to hear. But I respect licences as they are and the ODBCng driver is licenced under the GPL. That doesn't mean that you're not allowed to use

[GENERAL] md5() sorting

2007-11-07 Thread Karsten Hilbert
Hi, in GNUmed (wiki.gnumed.de) we use schema hashing to detect whether a database can safely be upgraded or used by a client. The general procedure is this: - generate a line-by-line representation of the database objects in the format schema.table.column::data type from the information

Re: [GENERAL] Syntax error in a large COPY

2007-11-07 Thread Alvaro Herrera
Reg Me Please wrote: P.S. Why not including the pgloader into the main tarball? We are not attempting to include every useful tool in the database server. We're actually moving in the opposite direction: stuff has been offloaded to pgfoundry as appropriate. Add-on packages are encouraged. If

Re: [GENERAL] Postgresql simple query performance question

2007-11-07 Thread Reg Me Please
Il Wednesday 07 November 2007 13:47:26 SHARMILA JOTHIRAJAH ha scritto: Hi we are testing with version PostgreSQL 8.2.3. Why not using at least the current 8.2.5? Read here http://www.postgresql.org/docs/current/static/release.html for details. -- Reg me Please

[GENERAL] Exclusive Locks Taken on User Tables?

2007-11-07 Thread Marc Breslow
Hi, I'm seeing an EXCLUSIVE lock being taken on a table even though the documentation says that This lock mode is not automatically acquired on user tables by any PostgreSQL command. My SQL is UPDATE users SET online = $1 where username = $2 username is the PK on the users table. Other locks

Re: [GENERAL] Exclusive Locks Taken on User Tables?

2007-11-07 Thread Marc Breslow
Version of postgres is 8.2.4. Maybe it will help to give more b/g on how I'm identifying the problem? The way this materializes as a real issue surrounds transactions left idle. There is a bug in our app that we haven't tracked down yet where on occasion we end up with connections marked IDLE in

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

2007-11-07 Thread Scott Marlowe
On 11/7/07, Tom Lane [EMAIL PROTECTED] wrote: A more general objection is that causing query semantics to change in subtle ways based on a GUC variable has more often than not proven to be a bad idea. On top of that, this is another one of those conversations that basically are predicated on

Re: DB on a ramdisk (was Re: [GENERAL] Temporary, In-memory Postgres DB?)

2007-11-07 Thread Bill Moran
In response to Gauthier, Dave [EMAIL PROTECTED]: One question I had earlier that I don't think got answered was how to undo an initdb. dropdb drops a DB, but how do I undo an initdb? rm -rf the directory in which you put the initdb. -- Bill Moran http://www.potentialtech.com

Re: [GENERAL] list of postgres related unexpected 'features'

2007-11-07 Thread Rainer Bauer
Sascha Bohnenkamp wrote: Is there a list postgres related unexpected 'features', like count(*) is expensive etc.? I do not ask to bash postgres, but to use it ... and it would be nice if I have not to try any pittfall by myself. Something like http://sql-info.de/postgresql/postgres-gotchas.html?

Re: [GENERAL] prepared statements suboptimal?

2007-11-07 Thread rihad
Tom Lane wrote: rihad [EMAIL PROTECTED] writes: I don't understand why postgres couldn't plan this: SELECT foo.e, foo.f FROM foo WHERE pk=$1 AND b=$2 AND status='1' AND c = $3; to be later executed any slower than SELECT foo.e, foo.f FROM foo WHERE pk='abcabc' AND b='13' AND status='1'

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

2007-11-07 Thread Tom Lane
Simon Riggs [EMAIL PROTECTED] writes: On Wed, 2007-11-07 at 10:23 -0500, Tom Lane wrote: I put this in the same category as altering the identifier case-folding rules. That has much less effect on application portability, Really? Try counting the number of requests for that in the

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

2007-11-07 Thread rihad
Simon Riggs wrote: On Wed, 2007-11-07 at 16:05 +0100, Martijn van Oosterhout wrote: On Wed, Nov 07, 2007 at 02:37:41PM +, Simon Riggs wrote: Editing an application, you would be required to add the words NULLS FIRST to every single ORDER BY and every single CREATE INDEX in an application.

Re: [GENERAL] md5() sorting

2007-11-07 Thread Karsten Hilbert
On Wed, Nov 07, 2007 at 05:36:47PM +0200, Marko Kreen wrote: I'm wondering if you cast the md5sum as a bytea instead of text and then sort, if that would solve it simply. Along the lines of ... ORDER BY decode(md5('...'), 'hex'); Maybe using digest(.., 'md5') function

Re: [GENERAL] Temporary, In-memory Postgres DB?

2007-11-07 Thread Gauthier, Dave
Yes, I'm thinking of a small DB (could fit into mem). And the notion that all the data would reside in memory makes sense. But what about the metadata? And there is the question of the initdb and all the stuff it creates. That goes to disk, yes? no? Another question, but first my tenuous

Re: [GENERAL] md5() sorting

2007-11-07 Thread Martijn van Oosterhout
On Wed, Nov 07, 2007 at 03:42:11PM +0100, Karsten Hilbert wrote: Should I be going about this sorting or hashing or detection business in another way entirely which can be done at the SQL level ? I'm wondering if you cast the md5sum as a bytea instead of text and then sort, if that would

Re: [GENERAL] Npsql is much faster than ODBC ?

2007-11-07 Thread Rainer Bauer
Andrej Ricnik-Bay wrote: On Nov 7, 2007 2:40 PM, Rainer Bauer [EMAIL PROTECTED] wrote: That's nice to hear. But I respect licences as they are and the ODBCng driver is licenced under the GPL. That doesn't mean that you're not allowed to use it with commercial applications; it just means that

Re: [GENERAL] Npsql is much faster than ODBC ?

2007-11-07 Thread Andrei Kovalevski
Rainer Bauer wrote: Alvaro Herrera wrote: Rainer Bauer wrote: Andrej Ricnik-Bay wrote: On Nov 7, 2007 2:40 PM, Rainer Bauer [EMAIL PROTECTED] wrote: That's nice to hear. But I respect licences as they are and the ODBCng driver is licenced under the GPL.

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

2007-11-07 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: Tom Lane [EMAIL PROTECTED] writes: Not unless it's locked down at initdb time. Otherwise flipping the value bars you from using every existing index ... including those on the system catalogs ... which were made with the other setting. Surely if we

Re: [GENERAL] Npsql is much faster than ODBC ?

2007-11-07 Thread Alvaro Herrera
Rainer Bauer wrote: Andrej Ricnik-Bay wrote: On Nov 7, 2007 2:40 PM, Rainer Bauer [EMAIL PROTECTED] wrote: That's nice to hear. But I respect licences as they are and the ODBCng driver is licenced under the GPL. That doesn't mean that you're not allowed to use it with commercial

Re: DB on a ramdisk (was Re: [GENERAL] Temporary, In-memory Postgres DB?)

2007-11-07 Thread Tom Lane
Ron Johnson [EMAIL PROTECTED] writes: On 11/07/07 09:58, Tom Lane wrote: Or put it on a ramdisk filesystem. But doesn't that just add more overhead and reduce the amount of memory that the OS can cache things in? It's very possibly not a win, but the kinds of people who ask this question at

Re: DB on a ramdisk (was Re: [GENERAL] Temporary, In-memory Postgres DB?)

2007-11-07 Thread Scott Marlowe
On 11/7/07, Ron Johnson [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/07 09:58, Tom Lane wrote: Ron Johnson [EMAIL PROTECTED] writes: On 11/07/07 09:03, Gauthier, Dave wrote: Is there such a thing as a temporary, probably in-memory, version of a

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

2007-11-07 Thread Simon Riggs
On Wed, 2007-11-07 at 10:23 -0500, Tom Lane wrote: Simon Riggs [EMAIL PROTECTED] writes: Perhaps we can have a parameter? default_null_sorting = 'last' # may alternatively be set to 'first' Not unless it's locked down at initdb time. Otherwise flipping the value bars you from using every

Re: [GENERAL] Temporary, In-memory Postgres DB?

2007-11-07 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/07 09:03, Gauthier, Dave wrote: This is a real longshot, but here goes... Is there such a thing as a temporary, probably in-memory, version of a Postgres DB? Sort of like SQLite, only with the features/function of PG? A DB like

[GENERAL] Recovering / undoing transactions?

2007-11-07 Thread Ivan Voras
Hi, About a month or so ago I read a blog entry or an article which seems to have described a method, using dirty hackery with pg_resetxlog and possibly other tools, to forcibly undo the database to a previous state. The problem described was that some employee had executed a DELETE or UPDATE

Re: [GENERAL] Npsql is much faster than ODBC ?

2007-11-07 Thread Greg Smith
On Wed, 7 Nov 2007, Rainer Bauer wrote: The way I read this section is that linking to a GPL ODBC driver would imply that I have to release my program under a GPL (compatible) licence. What you actually link against is the ODBC implementation for your platform. If you're on something

Re: [GENERAL] Postgresql simple query performance question

2007-11-07 Thread SHARMILA JOTHIRAJAH
Hi, The table has 43 columns. I have attached the columns-list.They have many char() and numeric columns. For the table size, these are the corresponding entries from the pg_class foo is the table and the others are some of its indexes. relname reltuples relpages foo

Re: [GENERAL] Npsql is much faster than ODBC ?

2007-11-07 Thread Peter Cai
Thanks. I have tried your program. But it seems that it has trouble with EUC_CN. It returns unrecoginzed value of empty columns. BTW: I've solved this problem. Every one using odbc on windows shuold read this mail: psqlODBC with Visual Studio 2005 and Connection Pooling for

Re: [GENERAL] Postgresql simple query performance question

2007-11-07 Thread SHARMILA JOTHIRAJAH
Hi we are testing with version PostgreSQL 8.2.3. We already have a production system in Oracle and we wanted to migrate it to postgresql. If some tests are already done, are the results available for us to see? Ill also check postgres 8.3 beta. Thanks again Sharmila - Original Message

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

2007-11-07 Thread Bruce Momjian
Simon Riggs wrote: If an application has already made that choice then we should allow them the opportunity to work with PostgreSQL. The application may be at fault, but PostgreSQL is the loser because of that decision. The SQL Standard says that the default for this is defined by the

Re: [GENERAL] Syntax error in a large COPY

2007-11-07 Thread Bill Moran
In response to Thomas Kellerer [EMAIL PROTECTED]: Tom Lane, 07.11.2007 06:14: Thomas Kellerer [EMAIL PROTECTED] writes: If everyone simply top-posted, there would be no need for me to scroll down, just to find a two line answer below a forty line quote - which I personally find

Re: [GENERAL] number errors

2007-11-07 Thread João Paulo Zavanela
Hi all, When my application returns errors from database, some numbers errors is equals. Why number errors is equals? odbc driver or postgresql return this? It's run in Windows. Thanks. Hello, If you use ODBC - you should devide error from ODBC driver and errors from PostgreSQL, ODBC

[GENERAL] odbcng

2007-11-07 Thread Sam Mason
On Tue, Nov 06, 2007 at 05:48:12PM -0300, Alvaro Herrera wrote: FYI there's another Postgres ODBC driver that is said to have better performance. https://projects.commandprompt.com/public/odbcng (Yes, my company maintains it) Are there any known issues when calling it from VB? I've got a

Re: [GENERAL] Syntax error in a large COPY

2007-11-07 Thread Andrej Ricnik-Bay
On 11/8/07, Collin Kidder [EMAIL PROTECTED] wrote: I'm with Thomas. I think that, while inline posting is a good thing, bottom posting is dead stupid and wastes my time. Just as bad as top-posting, really. It is far easier to follow a thread with top posting as the relevant text is right

Re: DB on a ramdisk (was Re: [GENERAL] Temporary, In-memory Postgres DB?)

2007-11-07 Thread Gauthier, Dave
I understand caching. Here's the reason I'm inquiring into this line of thought... I already have a big on-disk DB with lots and lots of data, and lots of stored functions and a data model that works with DB loaders and other code that queries out data. I also have users that want all of that,

Re: [GENERAL] strange timezone problem

2007-11-07 Thread Nick Johnson
On Wed, 7 Nov 2007, Tom Lane wrote: Nick Johnson [EMAIL PROTECTED] writes: I'm using PostgreSQL 8.2.3 and seeing this behaviour with timezones: [snip] Shouldn't that second row have been in the results of the second query? Huh? Those results look perfectly sane to me. Ah, you're

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

2007-11-07 Thread Tom Lane
Simon Riggs [EMAIL PROTECTED] writes: Perhaps we can have a parameter? default_null_sorting = 'last' # may alternatively be set to 'first' Not unless it's locked down at initdb time. Otherwise flipping the value bars you from using every existing index ... including those on the system

Re: [GENERAL] Temporary, In-memory Postgres DB?

2007-11-07 Thread Scott Marlowe
On 11/7/07, Gauthier, Dave [EMAIL PROTECTED] wrote: This is a real longshot, but here goes... Is there such a thing as a temporary, probably in-memory, version of a Postgres DB? Sort of like SQLite, only with the features/function of PG? A DB like this would exist inside of, and for the

Re: [GENERAL] Npsql is much faster than ODBC ?

2007-11-07 Thread Rainer Bauer
Greg Smith wrote: On Wed, 7 Nov 2007, Rainer Bauer wrote: The way I read this section is that linking to a GPL ODBC driver would imply that I have to release my program under a GPL (compatible) licence. What you actually link against is the ODBC implementation for your platform. If you're

Re: [GENERAL] prepared statements suboptimal?

2007-11-07 Thread Albe Laurenz
rihad wrote: Hi, I'm planning to use prepared statements of indefinite lifetime in a daemon that will execute same statements rather frequently in reply to client requests. This link: http://www.postgresql.org/docs/8.3/static/sql-prepare.html has a note on performance: In some

Re: [GENERAL] md5() sorting

2007-11-07 Thread Karsten Hilbert
On Wed, Nov 07, 2007 at 03:54:02PM +0100, Martijn van Oosterhout wrote: Should I be going about this sorting or hashing or detection business in another way entirely which can be done at the SQL level ? I'm wondering if you cast the md5sum as a bytea instead of text and then sort, if

[GENERAL] Rollback capacity

2007-11-07 Thread Jeff Larsen
Once again, I'm trying to translate my knowledge of Informix to PostgreSQL. I tried the manual and Google, but could not find anything relevant. Informix keeps transaction logs in a dedicated, pre-allocated disk area that, until very recent versions, could not grow dynamically. It is the DBA's

Re: [GENERAL] Rollback capacity

2007-11-07 Thread Tom Lane
Jeff Larsen [EMAIL PROTECTED] writes: Informix keeps transaction logs in a dedicated, pre-allocated disk area that, until very recent versions, could not grow dynamically. It is the DBA's responsibility to continually backup these transaction logs so the space may be recycled. As such,

Re: [GENERAL] Recovering / undoing transactions?

2007-11-07 Thread Tom Lane
Ivan Voras [EMAIL PROTECTED] writes: About a month or so ago I read a blog entry or an article which seems to have described a method, using dirty hackery with pg_resetxlog and possibly other tools, to forcibly undo the database to a previous state. The problem described was that some employee

Re: [GENERAL] Recovering / undoing transactions?

2007-11-07 Thread Ivan Voras
On 07/11/2007, Tom Lane [EMAIL PROTECTED] wrote: It's not really possible to do that. The blogger might've thought he'd accomplished something but I seriously doubt that his database was consistent afterward. You can go back in time using PITR, if you had the foresight and resources to set

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

2007-11-07 Thread Tomas Vondra
Reece Hart [EMAIL PROTECTED] writes: However, it's not clear that you've considered a clause like 'ORDER BY (foo IS NULL), foo', which I believe is not implementation dependent. Yeah, that should work reasonably portably ... where portable means equally lousy performance in every

[GENERAL] System V IPC on Windows

2007-11-07 Thread Kevin Neufeld
Does anyone know how to adjust the IPC settings in Windows? If I wanted to increase shared_buffers settings, in linux I would simply adjust the SHMMAX and SHMMIN settings, following the docs (http://www.postgresql.org/docs/8.2/static/kernel-resources.html#SYSVIPC). In Windows, ? Cheers,

Re: [GENERAL] Recovering / undoing transactions?

2007-11-07 Thread Tom Lane
Ivan Voras [EMAIL PROTECTED] writes: Ok, just to verify I'm thinking about it in the right way: in abstract, with PITR, I would need a known-good starting point (e.g. a full backup) + files from pg_xlog created from the time of the starting-point, then restore the starting-point backup and

Re: [GENERAL] System V IPC on Windows

2007-11-07 Thread Tom Lane
Kevin Neufeld [EMAIL PROTECTED] writes: Does anyone know how to adjust the IPC settings in Windows? There aren't any such settings in Windows, AFAIK. There's certainly not anything directly corresponding to SHMMAX, say. What have you run into that makes you think you need to adjust something?

[GENERAL] what is the date format in binary query results

2007-11-07 Thread Samantha Atkins
What can I expect for a date format from a PGresult containing binary results? Specifically the Oid type is TIMESTAMPTZOID. In this case what does the PQgetvalue actually return? What does the char* point to? Thanks. - samantha

Re: [GENERAL] Syntax error in a large COPY

2007-11-07 Thread Bruce Momjian
Andrej Ricnik-Bay wrote: On 11/8/07, Collin Kidder [EMAIL PROTECTED] wrote: I'm with Thomas. I think that, while inline posting is a good thing, bottom posting is dead stupid and wastes my time. Just as bad as top-posting, really. It is far easier to follow a thread with top posting

Re: [GENERAL] System V IPC on Windows

2007-11-07 Thread Magnus Hagander
Does anyone know how to adjust the IPC settings in Windows? There aren't any such settings in Windows, AFAIK. Correct. The only real adjustable limit is the size of the Windows pagefile, but that one is normally dynamic. But there must be room for all the shared memory in it. It's not