Re: [GENERAL] limit-offset different result sets with same query

2009-05-08 Thread David Fetter
On Fri, May 08, 2009 at 06:40:33PM -0300, Emanuel Calvo Franco wrote: > 2009/5/8 David Fetter : > > On Fri, May 08, 2009 at 06:10:18PM -0300, Emanuel Calvo Franco wrote: > >> Hi all. > >> > >> I'll make this faster. > >> > >> I hace this table and this function: > > > > You should only ever assume

Re: [GENERAL] Column oriented pgsql

2009-05-08 Thread bfriedman.postgresql
If you are looking for a column based dbms, you might want to check out Monet - it is a columnar database. http://monetdb.cwi.nl/ For some applications, columnar databases can be much faster than traditional rdbms systems. However, column based databases are not a 'one size fits all' answer.

Re: [GENERAL] Column oriented pgsql

2009-05-08 Thread John R Pierce
Joshua Tolley wrote: http://en.wikipedia.org/wiki/Column_oriented_database This has come up on the lists from time to time; the short answer is it's really hard. indeed. among other issues is, just what order should those columns be stored in? database tables have no implicit order, they

Re: [GENERAL] Column oriented pgsql

2009-05-08 Thread Mag Gam
Got it thanks! On Fri, May 8, 2009 at 2:57 PM, Christophe wrote: > > On May 8, 2009, at 11:25 AM, John R Pierce wrote: >> >> you read your tables by column, rather than by row?? >> SQL queries are inherently row oriented, the fundamental unit of storage >> is a 'tuple', which is a representatio

Re: [GENERAL] limit-offset different result sets with same query

2009-05-08 Thread Adam Rich
Emanuel Calvo Franco wrote: > > Executing 'select * from datos limit 1 offset 15' two times i have different > result sets. > When i execute 'explain analyze verbose ' i see that (as > expected) the seq scan > is occurring. > > > That's correct? Is logical that if the scan is sequential in

Re: [GENERAL] limit-offset different result sets with same query

2009-05-08 Thread Alvaro Herrera
David Fetter escribió: > On Fri, May 08, 2009 at 06:10:18PM -0300, Emanuel Calvo Franco wrote: > > Hi all. > > > > I'll make this faster. > > > > I hace this table and this function: > > You should only ever assume that your SELECT's output will have a > particular ordering when you include an O

Re: [GENERAL] limit-offset different result sets with same query

2009-05-08 Thread Emanuel Calvo Franco
2009/5/8 David Fetter : > On Fri, May 08, 2009 at 06:10:18PM -0300, Emanuel Calvo Franco wrote: >> Hi all. >> >> I'll make this faster. >> >> I hace this table and this function: > > You should only ever assume that your SELECT's output will have a > particular ordering when you include an ORDER BY

Re: [GENERAL] limit-offset different result sets with same query

2009-05-08 Thread David Fetter
On Fri, May 08, 2009 at 06:10:18PM -0300, Emanuel Calvo Franco wrote: > Hi all. > > I'll make this faster. > > I hace this table and this function: You should only ever assume that your SELECT's output will have a particular ordering when you include an ORDER BY clause that actually specifies th

Re: [GENERAL] limit-offset different result sets with same query

2009-05-08 Thread Emanuel Calvo Franco
2009/5/8 Tom Lane : > Emanuel Calvo Franco writes: >> Executing 'select * from datos limit 1 offset 15' two times i have >> different >> result sets. > > The "synchronous scan" logic is probably responsible.  Turn off > synchronize_seqscans if this behavior bothers you. > >                  

Re: [GENERAL] limit-offset different result sets with same query

2009-05-08 Thread Tom Lane
Emanuel Calvo Franco writes: > Executing 'select * from datos limit 1 offset 15' two times i have > different > result sets. The "synchronous scan" logic is probably responsible. Turn off synchronize_seqscans if this behavior bothers you. regards, tom lane -- Sent

[GENERAL] limit-offset different result sets with same query

2009-05-08 Thread Emanuel Calvo Franco
Hi all. I'll make this faster. I hace this table and this function: CREATE FUNCTION pg_round_random_range(integer, integer) RETURNS integer LANGUAGE plperl IMMUTABLE STRICT AS $_X$ my($imin, $imax) = @_; if ($_[0] == $_[1]){ return $_[0];} if($imin > $imax){ $imin = $_[1]; $imax = $_[0]

Re: [GENERAL] prepared statements and DBD::Pg

2009-05-08 Thread JP Fletcher
Daniel Verite wrote: Tim Bunce wrote: The example that started this thread was that this valid statement worked: prepare("CREATE TEMP TABLE foo(...); INSERT INTO foo(1, 1); INSERT INTO foo(2, 2);") but this valid statement didn't: prepare(" INSERT INTO foo(1, 1); INS

Re: [GENERAL] prepared statements and DBD::Pg

2009-05-08 Thread Daniel Verite
Tim Bunce wrote: The example that started this thread was that this valid statement worked: prepare("CREATE TEMP TABLE foo(...); INSERT INTO foo(1, 1); INSERT INTO foo(2, 2);") but this valid statement didn't: prepare(" INSERT INTO foo(1, 1); INSERT INTO foo(2, 2);") M

Re: [GENERAL] pg query exec time, reports

2009-05-08 Thread Bill Moran
In response to "Johnny Edge" : > > I wish to log query execution time on all queries. http://www.postgresql.org/docs/8.3/static/runtime-config-logging.html Specifically the log_*_statement directives. > Could you also suggest report generation tools? I.e. what queries take > longest time to e

[GENERAL] pg query exec time, reports

2009-05-08 Thread Johnny Edge
Hello folks, I wish to log query execution time on all queries. Could you please advise re the same? Could you also suggest report generation tools? I.e. what queries take longest time to exec, duration of session, etc. Thanks, -JE

Re: [GENERAL] Column oriented pgsql

2009-05-08 Thread Joshua Tolley
On Fri, May 08, 2009 at 11:25:30AM -0700, John R Pierce wrote: > Mag Gam wrote: >> Is it possible to tweak (easily) Postgresql so the storage is column >> oriented versus row-oriented? We would like to increase read >> optimization on our data which is about 2TB. >> >> > > you read your tables b

Re: [GENERAL] Column oriented pgsql

2009-05-08 Thread Christophe
On May 8, 2009, at 11:25 AM, John R Pierce wrote: you read your tables by column, rather than by row?? SQL queries are inherently row oriented, the fundamental unit of storage is a 'tuple', which is a representation of a row of a table. I believe what is referring to is the disk storage orga

Re: [GENERAL] Remote access

2009-05-08 Thread John R Pierce
George Weaver wrote: Hi, I have a client with a main office and a branch office about 90 miles away. They have a server at the main office but it is not a web server. What would be the best solution for them to access a PostgreSQL database located at the main office from the branch office

Re: [GENERAL] Column oriented pgsql

2009-05-08 Thread John R Pierce
Mag Gam wrote: Is it possible to tweak (easily) Postgresql so the storage is column oriented versus row-oriented? We would like to increase read optimization on our data which is about 2TB. you read your tables by column, rather than by row?? SQL queries are inherently row oriented, the

Re: [GENERAL] Controlling psql output

2009-05-08 Thread Gauthier, Dave
-A -t worked great. Thanks ! -dave -Original Message- From: Ben Chobot [mailto:be...@silentmedia.com] Sent: Friday, May 08, 2009 2:03 PM To: Gauthier, Dave Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Controlling psql output On Fri, 8 May 2009, Gauthier, Dave wrote: > Hi: >

Re: [GENERAL] Controlling psql output

2009-05-08 Thread Ben Chobot
On Fri, 8 May 2009, Gauthier, Dave wrote: Hi: Using a single psql command to generate stdout in linux that will be redirected to a file. Many rows with 1 column are returned. I want no header, no footer, no blank lines at the top or bottom, no initial space before each record. This is wha

Re: [GENERAL] Controlling psql output

2009-05-08 Thread Christophe
On May 8, 2009, at 9:51 AM, Gauthier, Dave wrote: This gets rid of the header and footer OK. But there is still a blank line as the first line in stdout. Also, each record has a preceding space before the column value. Is there a way to do what I want? sed?

Re: [GENERAL] Controlling psql output

2009-05-08 Thread Joshua D. Drake
On Fri, 2009-05-08 at 09:51 -0700, Gauthier, Dave wrote: > Hi: > > > > Using a single psql command to generate stdout in linux that will be > redirected to a file. Many rows with 1 column are returned. I want > no header, no footer, no blank lines at the top or bottom, no initial > space befo

[GENERAL] Controlling psql output

2009-05-08 Thread Gauthier, Dave
Hi: Using a single psql command to generate stdout in linux that will be redirected to a file. Many rows with 1 column are returned. I want no header, no footer, no blank lines at the top or bottom, no initial space before each record. This is what I'm trying... psql -P tuples_only=on,foote

Re: [GENERAL] structure of query does not match error during RETURN QUERY.

2009-05-08 Thread Michal Szymanski
We have tried to call it from PHP and from pgadmin the result is always the same. This is result from psql crm_test=# select * from cerber.cerber_account_select (1); WARNING: :ERROR:CERBER:cerber_account_select: Blad typu other w trakcie probu pobra

[GENERAL] Glitch Using a Rule to Copy Data to a Table

2009-05-08 Thread gwlucas
I have a glitch using a rule to copy data to a table. I was wondering if anyone could clarify why the following doesn’t work and suggest to me an alternate way of accomplishing my objective… I have a tables called (for sake of the example) “bravo” and “charlie”, and I want to use a rule to automa

Re: [GENERAL] structure of query does not match error during RETURN QUERY.

2009-05-08 Thread Gevik Babakhani
I see that now... I guess this is bug. please see: http://archives.postgresql.org//pgsql-bugs/2008-11/msg00172.php If it is possible for you, dump and restore the database. I hope this helps. Michal Szymanski wrote: We have tried to call it from PHP and from pgadmin the result is always the s

FW: [GENERAL] how many connections can i use????

2009-05-08 Thread Edmundo Robles L.
"Edmundo Robles L." writes: > I have a problem with the number of connections on postgres 7.2.1, -->egad ... the number of known bugs in that would curl your toes. -->Think about an upgrade. Do more than just think about it. yes, maybe the upgrade solve that problem, i will try with anoth

Re: [GENERAL] how many connections can i use????

2009-05-08 Thread Tom Lane
"Edmundo Robles L." writes: > I have a problem with the number of connections on postgres 7.2.1, egad ... the number of known bugs in that would curl your toes. Think about an upgrade. Do more than just think about it. > I changed the parameters line of postmaster to "-N 128 -B 256" , " >

Re: [GENERAL] structure of query does not match error during RETURN QUERY.

2009-05-08 Thread Gevik Babakhani
How do you call this function from your code? Does it work when you call it from PGAdmin? select * from cerber.cerber_account_select (1); Michal Szymanski wrote: Hi, We call DB procedure that select rows with given ID it works as simple SELECT but for future changes we implement as DB procedu

Re: [GENERAL] Remote access

2009-05-08 Thread George Weaver
- Original Message - From: "Bill Moran" To: "George Weaver" Cc: "pgsql-general" Sent: Friday, May 08, 2009 9:45 AM Subject: Re: [GENERAL] Remote access In response to "George Weaver" : [snip] I have clients with web-based servers which utilize my application connecting via the

Re: [GENERAL] Remote access

2009-05-08 Thread George Weaver
Hi Andrew, Interesting! Thanks for the detail. George - Original Message - From: Andrew Gould To: George Weaver Cc: pgsql-general Sent: Friday, May 08, 2009 9:57 AM Subject: Re: [GENERAL] Remote access On Fri, May 8, 2009 at 9:37 AM, George Weaver wrote: Andrew

[GENERAL] how many connections can i use????

2009-05-08 Thread Edmundo Robles L.
Hello there! I have a problem with the number of connections on postgres 7.2.1, yeah is a quite older :-) but i have it running on SCO OpenServer 5.0.7 and tried to change the number of connections above 100 but, i only got 100 sometimes 101 but no more. I changed the parameters li

Re: [GENERAL] migrating from MSSQL

2009-05-08 Thread David Fetter
On Fri, May 08, 2009 at 12:21:51AM -0700, Eugene . wrote: > > Hi all, > > I've been tasked with evaluating the feasibility of migrating our > in-house application from MSSQL to PostgreSQL. It is fairly old and > has lots of stored procedures, which is why we need to think > carefully before maki

Re: [GENERAL] prepared statements and DBD::Pg

2009-05-08 Thread Tim Bunce
On Fri, May 08, 2009 at 04:02:29PM +0200, Daniel Verite wrote: > Tim Bunce wrote: > >> So you're okay with breaking previously working, and prefectly valid, > DBI code? > > I think the rationale is that such code was working by virtue of how > prepare() was implemented in DBD::Pg, but was n

Re: [GENERAL] "No transaction in progress" warning

2009-05-08 Thread Tom Lane
Conrad Lender writes: > I looked into the startup scripts that are used here (Ubuntu 8.10): > ... > The pg_ctlcluster script parses postgresql.conf and, if log_filename and > log_directory aren't defined there, adds '-l > /var/log/postgresql/postgresql-8.3-main.log' as an option for pg_ctl. > This

Re: [GENERAL] migrating from MSSQL

2009-05-08 Thread Dave Page
On Fri, May 8, 2009 at 3:48 PM, Joshua D. Drake wrote: > On Fri, 2009-05-08 at 10:11 +0200, Magnus Hagander wrote: >> Eugene . wrote: > >> > Secondly, which commercial support vendor would you recommend? I found >> > EnterpriseDB and CommandPrompt, but I don't know anything about them. >> > Any ot

Re: [GENERAL] "No transaction in progress" warning

2009-05-08 Thread Conrad Lender
On 08/05/09 16:43, Conrad Lender wrote: > stderr to stdin to capture warnings and errors: That should be "stderr to stdout", of course. - Conrad -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql

Re: [GENERAL] Remote access

2009-05-08 Thread Andrew Gould
On Fri, May 8, 2009 at 9:37 AM, George Weaver wrote: > Andrew Gould in reponse to George Weaver wrote: > > Hi Andrew, >>> >> > Hi, > > I have a client with a main office and a branch office about 90 miles > away. > > They have a server at the main office but it is not a

Re: [GENERAL] structure of query does not match error during RETURN QUERY.

2009-05-08 Thread Michal Szymanski
We use Postgres 8.3.7 on Linux -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] structure of query does not match error during RETURN QUERY.

2009-05-08 Thread Michal Szymanski
Hi, We call DB procedure that select rows with given ID it works as simple SELECT but for future changes we implement as DB procedure (look below for DB listing). Recently we modified columns in table cerber.cerber_accoun and after this modification procedure does not work anymore and it returns 42

Re: [GENERAL] Remote access

2009-05-08 Thread George Weaver - Cleartag Software
Hi Andrew, Hi, I have a client with a main office and a branch office about 90 miles away. They have a server at the main office but it is not a web server. What would be the best solution for them to access a PostgreSQL database located at the main office from the branch office? I a

Re: [GENERAL] Remote access

2009-05-08 Thread Johan Nel
George Weaver wrote: Hi, I have a client with a main office and a branch office about 90 miles away. They have a server at the main office but it is not a web server. What would be the best solution for them to access a PostgreSQL database located at the main office from the branch office?

Re: [GENERAL] Remote access

2009-05-08 Thread Joshua D. Drake
On Fri, 2009-05-08 at 10:45 -0400, Bill Moran wrote: > In response to "George Weaver" : > proved you a static IP and rent you rack space for ~$150/month. > That kind of thing will provide you with the professional reliability > that most people expect but will never get from consumer DSL and > cab

Re: [GENERAL] migrating from MSSQL

2009-05-08 Thread Joshua D. Drake
On Fri, 2009-05-08 at 10:11 +0200, Magnus Hagander wrote: > Eugene . wrote: > > Secondly, which commercial support vendor would you recommend? I found > > EnterpriseDB and CommandPrompt, but I don't know anything about them. > > Any other candidates? > As a person from Command Prompt :) we do ha

Re: [GENERAL] Remote access

2009-05-08 Thread Bill Moran
In response to "George Weaver" : [snip] > I have clients with web-based servers which utilize my application > connecting via the internet. I guess where my ignorance manifests itself is > how to connect when the server is not a web server and doesn't have a fixed > IP address. Is it necess

Re: [GENERAL] "No transaction in progress" warning

2009-05-08 Thread Conrad Lender
On 07/05/09 18:26, Tom Lane wrote: > Scott Mead writes: >> How did you restart postgres? I'm guessing that you're using a >> distribution provided package. If you're using the /etc/init.d >> scripts from that package, it's likely that the startup script is >> redirecting stderr and that the syst

Re: [GENERAL] Remote access

2009-05-08 Thread George Weaver
Andrew Gould in reponse to George Weaver wrote: Hi Andrew, Hi, I have a client with a main office and a branch office about 90 miles away. They have a server at the main office but it is not a web server. What would be the best solution for them to access a PostgreSQL database locat

Re: [GENERAL] Remote access

2009-05-08 Thread Craig Ringer
A. Kretschmer wrote: > There are some ways to do that, for instance a so called SSH-Tunnel, > read http://docs.planetargon.com/PostgreSQL_SSH_Tunnel SSH tunneling transports TCP over a TCP encapsulation. The adaptive rate control may not work how you'd expect; I've had some odd issues with SSH tu

Re: [GENERAL] prepared statements and DBD::Pg

2009-05-08 Thread David Fetter
On Fri, May 08, 2009 at 09:44:56AM +0100, Tim Bunce wrote: > On Thu, May 07, 2009 at 06:08:12PM -0700, David Fetter wrote: > > On Fri, May 08, 2009 at 01:02:04AM +0100, Tim Bunce wrote: > > > On Thu, May 07, 2009 at 06:50:11AM -0700, David Fetter wrote: > > > > On Thu, May 07, 2009 at 02:31:08PM +0

Re: [GENERAL] Remote access

2009-05-08 Thread Andrew Gould
On Fri, May 8, 2009 at 9:07 AM, George Weaver - Cleartag Software < gwea...@cleartagsoftware.com> wrote: > > Hi Andrew, > > Hi, >>> >> > I have a client with a main office and a branch office about 90 miles >>> away. >>> >> > They have a server at the main office but it is not a web server. >>>

Re: [GENERAL] Remote access

2009-05-08 Thread George Weaver
From: "A. Kretschmer" In response to George Weaver : Hi, I have a client with a main office and a branch office about 90 miles away. They have a server at the main office but it is not a web server. What would be the best solution for them to access a PostgreSQL database located at the

Re: [GENERAL] prepared statements and DBD::Pg

2009-05-08 Thread Daniel Verite
Tim Bunce wrote: So you're okay with breaking previously working, and prefectly valid, DBI code? I think the rationale is that such code was working by virtue of how prepare() was implemented in DBD::Pg, but was not "valid" nonetheless, as outlined with this example: http://archives

Re: [GENERAL] Remote access

2009-05-08 Thread A. Kretschmer
In response to George Weaver : > Hi, > > I have a client with a main office and a branch office about 90 miles away. > > They have a server at the main office but it is not a web server. > > What would be the best solution for them to access a PostgreSQL database > located at the main office

Re: [GENERAL] migrating from MSSQL

2009-05-08 Thread Bill Moran
In response to johnf : > On Friday 08 May 2009 12:08:44 am Eugene . wrote: > > Hi all, > > > > I've been tasked with evaluating the feasibility of migrating our in-house > > application from MSSQL to PostgreSQL. It is fairly old and has lots of > > stored procedures, which is why we need to think

[GENERAL] Remote access

2009-05-08 Thread George Weaver
Hi, I have a client with a main office and a branch office about 90 miles away. They have a server at the main office but it is not a web server. What would be the best solution for them to access a PostgreSQL database located at the main office from the branch office? I am not "network savvy"

Re: [GENERAL] migrating from MSSQL

2009-05-08 Thread johnf
On Friday 08 May 2009 12:08:44 am Eugene . wrote: > Hi all, > > I've been tasked with evaluating the feasibility of migrating our in-house > application from MSSQL to PostgreSQL. It is fairly old and has lots of > stored procedures, which is why we need to think carefully before making > the switch

Re: [GENERAL] migrating from MSSQL

2009-05-08 Thread Simon Riggs
On Fri, 2009-05-08 at 00:08 -0700, Eugene . wrote: > Secondly, which commercial support vendor would you recommend? I found > EnterpriseDB and CommandPrompt, but I don't know anything about them. > Any other candidates? Those two companies operate mostly in US. There are various other companies

Re: [GENERAL] Question about function returning record

2009-05-08 Thread Merlin Moncure
On Thu, May 7, 2009 at 7:37 AM, Markus Wollny wrote: > Hi! > > I've got a generalized function > >        getshadowrecord(schema (varchar),table (varchar), id (int4), > version_id (int)) > > which returns RECORD. As this function is supposed to work on any table > structure, I need to declare a co

[GENERAL] Accessing pg_controldata information from SQL

2009-05-08 Thread Massa, Harald Armin
Hello, is there any way to acess the pg_controldata information via SQL? (running pg_controldata via shell needs file access to the postgresql data dictionary, which is usually not given) Harald -- GHUM Harald Massa persuadere et programmare Harald Armin Massa Spielberger Straße 49 70435 Stutt

Re: [GENERAL] A question about RAISE NOTICE

2009-05-08 Thread Luigi N. Puleio
Since I'm executing this from a PgSQL function, can be SQLWarning eventually called from inside the function? and to use it let me guess I have to install something related to java like JRE 1.5.0?... Thanks Ciao, Luigi --- On Thu, 5/7/09, Kris Jurka wrote: From: Kris Jurka Subject: Re

[GENERAL] Column oriented pgsql

2009-05-08 Thread Mag Gam
Is it possible to tweak (easily) Postgresql so the storage is column oriented versus row-oriented? We would like to increase read optimization on our data which is about 2TB. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.pos

Re: [GENERAL] prepared statements and DBD::Pg

2009-05-08 Thread Tim Bunce
On Thu, May 07, 2009 at 06:08:12PM -0700, David Fetter wrote: > On Fri, May 08, 2009 at 01:02:04AM +0100, Tim Bunce wrote: > > On Thu, May 07, 2009 at 06:50:11AM -0700, David Fetter wrote: > > > On Thu, May 07, 2009 at 02:31:08PM +0100, Tim Bunce wrote: > > > > On Thu, May 07, 2009 at 04:54:06AM +1

Re: [GENERAL] migrating from MSSQL

2009-05-08 Thread Gevik Babakhani
Hi I have migrated a very large database from MSSQL to PG. This was a database of +/- 400 tables. You should note the following. - MSSQL datatypes are not always compatible with PG datatypes. If you do this carefully PG will save you a lot of time. - The "timestamp" datatype of MSSQL is not t

Re: [GENERAL] migrating from MSSQL

2009-05-08 Thread Magnus Hagander
Eugene . wrote: > > Hi all, > > I've been tasked with evaluating the feasibility of migrating our > in-house application from MSSQL to PostgreSQL. It is fairly old and has > lots of stored procedures, which is why we need to think carefully > before making the switch. Does anyone else have a simi

Re: [GENERAL] migrating from MSSQL

2009-05-08 Thread John R Pierce
Eugene . wrote: Hi all, I've been tasked with evaluating the feasibility of migrating our in-house application from MSSQL to PostgreSQL. It is fairly old and has lots of stored procedures, which is why we need to think carefully before making the switch. Does anyone else have a similar experi

[GENERAL] migrating from MSSQL

2009-05-08 Thread Eugene .
Hi all, I've been tasked with evaluating the feasibility of migrating our in-house application from MSSQL to PostgreSQL. It is fairly old and has lots of stored procedures, which is why we need to think carefully before making the switch. Does anyone else have a similar experience? What are some

[GENERAL] migrating from MSSQL

2009-05-08 Thread Eugene .
Hi all, I've been tasked with evaluating the feasibility of migrating our in-house application from MSSQL to PostgreSQL. It is fairly old and has lots of stored procedures, which is why we need to think carefully before making the switch. Does anyone else have a similar experience? What are som