Re: [GENERAL] psql screen size

2008-11-03 Thread wstrzalka
Messed up - I mean when going up and scrolling command history it shows long queries (eg 2 line long) in single line and the exceeding part overwrites the beginning of the query), or when writing long SQL at some point I'm starting to overwriting it from the beginning of the line. Sometimes when

Re: [GENERAL] Cannot remember what to do to get the information_schema, pg_catalog etc showing.

2008-11-03 Thread Rainer Bauer
Johan Nel wrote: Did an installation of PostgreSQL on a new laptop and I just cannot remember which .sql script to run to have the above schemas showing in pgAdmin or is it something to do with a checkbox/setting during installation? File Options... Display [x] Show System Objects in the

Re: [GENERAL] Date data type

2008-11-03 Thread Albe Laurenz
Mike Hall wrote: I'm currently converting an MS Access database to PostgreSQL (version 8.1 as it is the vesion that ships with CentOS 5). I'm having trouble with an INSERT statement attempting to insert an empty value ('') into a field with data type DATE. This produces the following

Re: [GENERAL] Date data type

2008-11-03 Thread Craig Ringer
Mike Hall wrote: I'm currently converting an MS Access database to PostgreSQL (version 8.1 as it is the vesion that ships with CentOS 5). What version of Microsoft Access are you using? I haven't seen this issue with Access 2007, which I've been forced to use in a recent project. It actually

[GENERAL] Is there a simple function for copiing cursor data into array?

2008-11-03 Thread alebu
Hi list, I am searching for function which creates or appends to array content of cursor. I found that it is possible to get select result as array so it is probably logical to have something similar for cursors. I mean, there is copy-paste from documentation for 8.3 version: - SELECT

Re: [GENERAL] Advantage of more than 1 tablespace on 1 disk?

2008-11-03 Thread Grzegorz Jaśkiewicz
what you want in case of the table that gets read a lot, is partition + cluster. For table that changes a lot, I don't really know myself either. It is usually trial and error type of scenario for me. (partitioning too, but that depends on what parts are updated and under what conditions, etc).

Re: [GENERAL] Redefining an existing Table Schema for Foreign Key Constraint - Question

2008-11-03 Thread Harald Fuchs
In article [EMAIL PROTECTED], Brian714 [EMAIL PROTECTED] writes: Currently, the database contains thousands of records in the Customers and Creditcards tables. I would like to re-define the Customers table to follow the following schema: Customers Table id:integer -- primary key

Re: [GENERAL] Is there a simple function for copiing cursor data into array?

2008-11-03 Thread Pavel Stehule
Hello 2008/11/3 alebu [EMAIL PROTECTED]: Hi list, I am searching for function which creates or appends to array content of cursor. I found that it is possible to get select result as array so it is probably logical to have something similar for cursors. I mean, there is copy-paste from

Re: [GENERAL] Connections getting stuck sending data to client (FIXED)

2008-11-03 Thread Chris Butler
[Forgot to send this to the list first time] On Fri, Oct 31, 2008 at 12:27:27PM -0600, Scott Marlowe wrote: On Fri, Oct 31, 2008 at 9:36 AM, Chris Butler [EMAIL PROTECTED] wrote: I've been having intermittent problems with our DB server (running postgresql 8.3.3) reaching its connection

[GENERAL] Advantage of more than 1 tablespace on 1 disk?

2008-11-03 Thread Thom Brown
Hi, I've got a database with massive tables which fall into 2 categories: Tables which don't change often but get read a LOT, and tables which are heavily added to continuously and sometimes read. Would there be any advantage in moving the latter logging tables to a separate tablespace, bearing

[GENERAL] raise notice, psql and having some feedback from scripts

2008-11-03 Thread Ivan Sergio Borgonovo
I just have some batch work in scripts that I pass through: psql script.sql script.log or may be run by cron. In sql raise notice is not available. Is there any other way to send messages to the logs without polluting them too much with -a? -- Ivan Sergio Borgonovo

Re: [GENERAL] Performance of views

2008-11-03 Thread Russ Brown
Tom Lane wrote: Scott Marlowe [EMAIL PROTECTED] writes: Note that, at least in older versions, MySQL completely materialized a temporary table from a view, then used that for the view. This is horribly inefficient, and results in a lot of people thinking views are slow. Not sure if this has

Re: [GENERAL] raise notice, psql and having some feedback from scripts

2008-11-03 Thread Sam Mason
On Mon, Nov 03, 2008 at 03:14:14PM +0100, Ivan Sergio Borgonovo wrote: I just have some batch work in scripts that I pass through: psql script.sql script.log or may be run by cron. In sql raise notice is not available. Is there any other way to send messages to the logs without

Re: [GENERAL] Are there plans to add data compression feature to postgresql?

2008-11-03 Thread Craig Ringer
Peter Eisentraut wrote: Craig Ringer wrote: So - it's potentially even worth compressing the wire protocol for use on a 100 megabit LAN if a lightweight scheme like LZO can be used. LZO is under the GPL though. Good point. I'm so used to libraries being under more appropriate licenses like

[GENERAL] JDBC: How to pass array in prepared statement for stored procedure execution?

2008-11-03 Thread alebu
Hi list, This question is general for any database JDBC but I think it's ok if I post it here. Lets say I have s stored procedure which gets an array of objects like one of it IN parameters. How can I pass an array of my objects into JDBC PreparedStatement object? The only recomendation I saw was

Re: [GENERAL] JDBC: How to pass array in prepared statement for stored procedure execution?

2008-11-03 Thread Tom Lane
alebu [EMAIL PROTECTED] writes: How can I pass an array of my objects into JDBC PreparedStatement object? The folks who would know this are more likely to notice your question if you ask on pgsql-jdbc ... regards, tom lane -- Sent via pgsql-general mailing list

[GENERAL] gin index creation performance problems

2008-11-03 Thread Ivan Sergio Borgonovo
I'm looking for a bit more guidance on gin index creation. The process: - vaccum analyze. - start a transaction that: - drop the triggers to update a tsvector - drop the index on the tsvector - fill several tables - update the tsvector in a table with ~800K records - recreate the gin index -

Re: [GENERAL] gin index creation performance problems

2008-11-03 Thread Ivan Sergio Borgonovo
On Mon, 3 Nov 2008 16:45:35 +0100 Ivan Sergio Borgonovo [EMAIL PROTECTED] wrote: Forgot to add that top say postgresql is using 100% CPU and 15% memory. I'm looking for a bit more guidance on gin index creation. The process: - vaccum analyze. - start a transaction that: - drop the

Re: [GENERAL] gin index creation performance problems

2008-11-03 Thread Oleg Bartunov
On Mon, 3 Nov 2008, Ivan Sergio Borgonovo wrote: I'm looking for a bit more guidance on gin index creation. The process: - vaccum analyze. - start a transaction that: - drop the triggers to update a tsvector - drop the index on the tsvector - fill several tables - update the tsvector in a

Re: [GENERAL] gin index creation performance problems

2008-11-03 Thread Tom Lane
Ivan Sergio Borgonovo [EMAIL PROTECTED] writes: maintenance_work_mem is still untouched. What would be a good value to start from? GIN index build time is *very* sensitive to maintenance_work_mem. Try cranking it up to a couple hundred megabytes and see if that helps. Also, if you're on 8.2, I

[GENERAL] Specific user does not require password for postgres

2008-11-03 Thread Serge Fonville
Hi, I have installed PostgreSQL 8.3.4 on Windows Vista Business Edition. My currently logged on user is the only user that does not need to specify a password when running psql -U postgres I used the following guide: PostgreSQL on Windows with SSL -- --All

Re: [GENERAL] Are there plans to add data compression feature to postgresql?

2008-11-03 Thread Peter Eisentraut
Craig Ringer wrote: So - it's potentially even worth compressing the wire protocol for use on a 100 megabit LAN if a lightweight scheme like LZO can be used. LZO is under the GPL though. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] Advantage of more than 1 tablespace on 1 disk?

2008-11-03 Thread Rainer Pruy
Hi Thom, table spaces are not in the first place related with addressing usage pattern of individual tables. They are a mechanism for putting up a *logical* layout of persistent storage. As such they are describing segments of persistence storage that will (or might from the point of view of

[GENERAL] Error en generar base espacial

2008-11-03 Thread Eduardo Arévalo
Hola He instalado el: Porgressql 8.3 en /usr/local/postgres_8.3 Postgis 1.3 en /usr/local/ postgis_13 geos 3 en /usr/local/geos_3 proj46 en /usr/local/proj_46 creo la base de datos pero al momento de incorporar la parte espacial con el siguiente comedo: -bash-3.2$ ./psql -f

Re: [GENERAL] valid use of wildcard

2008-11-03 Thread Irene Barg
The 'real' problem was the database had not been re-indexed in a long while (it is a test system). After re-indexing the db, the query below ran fairly quicky: metadata=# SELECT * FROM viewspace.siap AS t WHERE t.startDate='2008-10-27%' AND t.prop_id LIKE '%' LIMIT 1000; The 'startDate' is

Re: [GENERAL] Error en generar base espacial

2008-11-03 Thread Alvaro Herrera
Eduardo Arévalo escribió: Hola He instalado el: Porgressql 8.3 en /usr/local/postgres_8.3 Postgis 1.3 en /usr/local/ postgis_13 geos 3 en /usr/local/geos_3 proj46 en /usr/local/proj_46 creo la base de datos pero al momento de incorporar la parte espacial con el siguiente comedo:

[GENERAL] Debugging infrequent pegged out CPU usage

2008-11-03 Thread Jason Long
I am running PostgreSQL 8.3.4 on Centos 5.2 with a single Xeon 5472, 1600 MHz, 12 MB cache, 3.0 GHz quad core, and 4 GB RAM. My database is only about 50 MB and there are only about 20 users. For some reason Postgres is pegging my CPU and I can barely log on to reboot the machine. After

[GENERAL] TIME column manipulation/comparison hangups

2008-11-03 Thread Bill Moran
I'm trying to test the time in a time column to see if it's the same minute as the current time. I wouldn't have thought this would be difficult: WHERE TO_CHAR(now(), 'HH24MI') = TO_CHAR(time_column, 'HH24MI') Doesn't work, though: ERROR: function to_char(time with time zone, unknown) does

Re: [GENERAL] TIME column manipulation/comparison hangups

2008-11-03 Thread Raymond O'Donnell
On 03/11/2008 19:01, Bill Moran wrote: It seems as if EXTRACT() will work, but it sure feels hacky to do: (extract(hours from now()) = extract(hours from time_column) AND (extract(minutes from now()) = extract(minutes from time_column) I'd have thought that this was the correct way to

Re: [GENERAL] TIME column manipulation/comparison hangups

2008-11-03 Thread Scott Marlowe
On Mon, Nov 3, 2008 at 12:01 PM, Bill Moran [EMAIL PROTECTED] wrote: I'm trying to test the time in a time column to see if it's the same minute as the current time. I wouldn't have thought this would be difficult: WHERE TO_CHAR(now(), 'HH24MI') = TO_CHAR(time_column, 'HH24MI') Use

Re: [GENERAL] Debugging infrequent pegged out CPU usage

2008-11-03 Thread Alan Hodgson
On Monday 03 November 2008, Jason Long [EMAIL PROTECTED] wrote: I would greatly appreciate any advice on debugging this problem. While there are relatively live few users the data is extremely important and the users will not wait for me to see what is wrong. They demand immediate

Re: [GENERAL] Debugging infrequent pegged out CPU usage

2008-11-03 Thread Tom Lane
Jason Long [EMAIL PROTECTED] writes: For some reason Postgres is pegging my CPU and I can barely log on to reboot the machine. Well, you need to find out why. Turning on query logging (see log_statement) would probably be a good first step --- it'd help you determine if there's a specific

Re: [GENERAL] Debugging infrequent pegged out CPU usage

2008-11-03 Thread Scott Marlowe
On Mon, Nov 3, 2008 at 11:30 AM, Jason Long [EMAIL PROTECTED] wrote: I am running PostgreSQL 8.3.4 on Centos 5.2 with a single Xeon 5472, 1600 MHz, 12 MB cache, 3.0 GHz quad core, and 4 GB RAM. My database is only about 50 MB and there are only about 20 users. For some reason Postgres is

Re: [GENERAL] TIME column manipulation/comparison hangups

2008-11-03 Thread Bill Moran
In response to Scott Marlowe [EMAIL PROTECTED]: On Mon, Nov 3, 2008 at 12:01 PM, Bill Moran [EMAIL PROTECTED] wrote: I'm trying to test the time in a time column to see if it's the same minute as the current time. I wouldn't have thought this would be difficult: WHERE

Re: [GENERAL] Debugging infrequent pegged out CPU usage

2008-11-03 Thread Scott Marlowe
On Mon, Nov 3, 2008 at 12:25 PM, Scott Marlowe [EMAIL PROTECTED] wrote: On Mon, Nov 3, 2008 at 11:30 AM, Jason Long [EMAIL PROTECTED] wrote: I am running PostgreSQL 8.3.4 on Centos 5.2 with a single Xeon 5472, 1600 MHz, 12 MB cache, 3.0 GHz quad core, and 4 GB RAM. My database is only about

Re: [GENERAL] TIME column manipulation/comparison hangups

2008-11-03 Thread Scott Marlowe
On Mon, Nov 3, 2008 at 12:25 PM, Bill Moran [EMAIL PROTECTED] wrote: In response to Scott Marlowe [EMAIL PROTECTED]: On Mon, Nov 3, 2008 at 12:01 PM, Bill Moran [EMAIL PROTECTED] wrote: I'm trying to test the time in a time column to see if it's the same minute as the current time. I

Re: [GENERAL] Specific user does not require password for postgres

2008-11-03 Thread Raymond O'Donnell
On 03/11/2008 16:21, Serge Fonville wrote: Hi, I have installed PostgreSQL 8.3.4 on Windows Vista Business Edition. My currently logged on user is the only user that does not need to specify a password when running psql -U postgres What happens if you log in as a different user and then try

Re: [GENERAL] TIME column manipulation/comparison hangups

2008-11-03 Thread Scott Marlowe
On Mon, Nov 3, 2008 at 12:31 PM, Scott Marlowe [EMAIL PROTECTED] wrote: On Mon, Nov 3, 2008 at 12:25 PM, Bill Moran [EMAIL PROTECTED] wrote: In response to Scott Marlowe [EMAIL PROTECTED]: On Mon, Nov 3, 2008 at 12:01 PM, Bill Moran [EMAIL PROTECTED] wrote: I'm trying to test the time in

date_trun() with timezones? (was Re: [GENERAL] TIME column manipulation/comparison hangups)

2008-11-03 Thread Bill Moran
In response to Scott Marlowe [EMAIL PROTECTED]: On Mon, Nov 3, 2008 at 12:25 PM, Bill Moran [EMAIL PROTECTED] wrote: In response to Scott Marlowe [EMAIL PROTECTED]: On Mon, Nov 3, 2008 at 12:01 PM, Bill Moran [EMAIL PROTECTED] wrote: I'm trying to test the time in a time column to

Re: date_trun() with timezones? (was Re: [GENERAL] TIME column manipulation/comparison hangups)

2008-11-03 Thread Tom Lane
Bill Moran [EMAIL PROTECTED] writes: Not quite. As shown in the examples, date_trunc() works fine on TIME WITHOUT TIME ZONE, but there's no such function for TIME WITH TIME ZONE. Well, actually there's no date_trunc for time either: regression=# \df date_trunc

Re: [GENERAL] Debugging infrequent pegged out CPU usage

2008-11-03 Thread Jason Long
Scott Marlowe wrote: On Mon, Nov 3, 2008 at 12:25 PM, Scott Marlowe [EMAIL PROTECTED] wrote: On Mon, Nov 3, 2008 at 11:30 AM, Jason Long [EMAIL PROTECTED] wrote: I am running PostgreSQL 8.3.4 on Centos 5.2 with a single Xeon 5472, 1600 MHz, 12 MB cache, 3.0 GHz quad core, and 4 GB RAM.

pg_casts view (was Re: date_trun() with timezones? (was Re: [GENERAL] TIME column ...))

2008-11-03 Thread Alvaro Herrera
Tom Lane escribió: However, the interval version of the function can capture the time case because there's an implicit cast from time to interval: regression=# select casttarget::regtype,castcontext,castfunc::regprocedure from pg_cast where castsource = 'time'::regtype; casttarget

Re: pg_casts view (was Re: date_trun() with timezones? (was Re: [GENERAL] TIME column ...))

2008-11-03 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane escribió: regression=# select casttarget::regtype,castcontext,castfunc::regprocedure from pg_cast where castsource = 'time'::regtype; BTW it very much looks like we should have a pg_casts view that displays these things in a human-readable

Re: pg_casts view (was Re: date_trun() with timezones? (was Re: [GENERAL] TIME column ...))

2008-11-03 Thread Alvaro Herrera
Tom Lane escribió: Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane escribi�: regression=# select casttarget::regtype,castcontext,castfunc::regprocedure from pg_cast where castsource = 'time'::regtype; BTW it very much looks like we should have a pg_casts view that displays these

[GENERAL] INSERT with RETURNING clause inside SQL function

2008-11-03 Thread Diego Schulz
Hi all, I'm re-writing some functions and migrating bussines logic from a client application to PostgreSQL. I expected something like this to work, but it doesn't: -- simple table CREATE TABLE sometable ( id SERIAL PRIMARY KEY, text1 text, text2 text ); CREATE OR REPLACE FUNCTION

Re: [GENERAL] INSERT with RETURNING clause inside SQL function

2008-11-03 Thread Diego Schulz
Forgot to mention: using 8.3.3 on FreeBSD. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Debugging infrequent pegged out CPU usage

2008-11-03 Thread Chris
Jason Long wrote: Scott Marlowe wrote: On Mon, Nov 3, 2008 at 12:25 PM, Scott Marlowe [EMAIL PROTECTED] wrote: On Mon, Nov 3, 2008 at 11:30 AM, Jason Long [EMAIL PROTECTED] wrote: I am running PostgreSQL 8.3.4 on Centos 5.2 with a single Xeon 5472, 1600 MHz, 12 MB cache, 3.0 GHz quad

Re: [GENERAL] Are there plans to add data compression feature to postgresql?

2008-11-03 Thread Scott Ribe
It doesn't matter that much, anyway, in that deflate would also do the job quite well for any sort of site-to-site or user-to-site WAN link. I used to use that, then switched to bzip. Thing is, if your client is really just issuing SQL, how much does it matter? Compression can't help with

Re: [GENERAL] INSERT with RETURNING clause inside SQL function

2008-11-03 Thread Tom Lane
Diego Schulz [EMAIL PROTECTED] writes: I expected something like this to work, but it doesn't: CREATE OR REPLACE FUNCTION add_something(text, text) RETURNS INTEGER AS $$ INSERT INTO sometable (id, foo, bar ) VALUES (DEFAULT, $1, $2 ) RETURNING id ; $$ LANGUAGE SQL ; This case was

[GENERAL] JDBC and setting statement_timeout

2008-11-03 Thread Jason Long
In order to keep my application from freezing up when a query pegs my CPU I set statement_timeout=12, but I read in the manual Setting statement_timeout in postgresql.conf is not recommended because it affects all sessions. I am used JDBC exclusively for the applicatoin and I read here

Re: [GENERAL] JDBC and setting statement_timeout

2008-11-03 Thread Kris Jurka
On Mon, 3 Nov 2008, Jason Long wrote: *Would someone please comment on the status of setQueryTimeout in the JDBC driver? Is there any workaround if this is still not implemented?* setQueryTimeout is not implemented, the workaround is to manually issue SET statement_timeout = xxx calls

Re: [GENERAL] INSERT with RETURNING clause inside SQL function

2008-11-03 Thread Raymond O'Donnell
On 04/11/2008 01:20, Diego Schulz wrote: I also tried this (somewhat silly) syntax to circumvent the issue without resorting in currval: Just curious - what have you got against currval()? It seems to me that it would make your life easier Ray.

Re: [GENERAL] gin index creation performance problems

2008-11-03 Thread Ivan Sergio Borgonovo
On Mon, 03 Nov 2008 11:04:45 -0500 Tom Lane [EMAIL PROTECTED] wrote: Ivan Sergio Borgonovo [EMAIL PROTECTED] writes: maintenance_work_mem is still untouched. What would be a good value to start from? GIN index build time is *very* sensitive to maintenance_work_mem. Try cranking it up to a

Re: [GENERAL] Are there plans to add data compression feature to postgresql?

2008-11-03 Thread Craig Ringer
Scott Ribe wrote: It doesn't matter that much, anyway, in that deflate would also do the job quite well for any sort of site-to-site or user-to-site WAN link. I used to use that, then switched to bzip. Thing is, if your client is really just issuing SQL, how much does it matter? It depends

[GENERAL] I'm puzzled by a foreign key constraint problem

2008-11-03 Thread Jonathan Guthrie
I've been tearing my hair out over this one issue and I'm hoping that someone on this list will have an insight on the matter that will shed some light on why the system is doing what it's doing. I have a database with a number of tables, two of which are projects and resources. We also have a

Re: [GENERAL] INSERT with RETURNING clause inside SQL function

2008-11-03 Thread Diego Schulz
On Mon, Nov 3, 2008 at 10:24 PM, Raymond O'Donnell [EMAIL PROTECTED] wrote: On 04/11/2008 01:20, Diego Schulz wrote: I also tried this (somewhat silly) syntax to circumvent the issue without resorting in currval: Just curious - what have you got against currval()? It seems to me that it

Re: [GENERAL] I'm puzzled by a foreign key constraint problem

2008-11-03 Thread Craig Ringer
Jonathan Guthrie wrote: The stored procedures (250 or so of them) have been converted into Postgres functions using a tool called SQLWays. I'm using named prepared procedures for each of the Postgres functions that are called, plus three, BEGIN, COMMIT, and ROLLBACK, which consist of the

Re: [GENERAL] INSERT with RETURNING clause inside SQL function

2008-11-03 Thread Diego Schulz
On Mon, Nov 3, 2008 at 8:51 PM, Tom Lane [EMAIL PROTECTED] wrote: Diego Schulz [EMAIL PROTECTED] writes: I expected something like this to work, but it doesn't: CREATE OR REPLACE FUNCTION add_something(text, text) RETURNS INTEGER AS $$ INSERT INTO sometable (id, foo, bar ) VALUES (DEFAULT,

Re: [GENERAL] INSERT with RETURNING clause inside SQL function

2008-11-03 Thread Tom Lane
Diego Schulz [EMAIL PROTECTED] writes: On Mon, Nov 3, 2008 at 10:24 PM, Raymond O'Donnell [EMAIL PROTECTED] wrote: Just curious - what have you got against currval()? It seems to me that it would make your life easier I simply don't like having to cast from BIGINT to INTEGER, Under what

Re: [GENERAL] I'm puzzled by a foreign key constraint problem

2008-11-03 Thread Richard Huxton
Jonathan Guthrie wrote: When I create a project, entries in the project table and the resource table are created in a single function. Then, separate functions are called to set the owner's access to the new project. These other functions are failing because of the resourceid foreign key