[GENERAL] pg_largeobject vs pg_toast_XXXX

2011-07-28 Thread bubba postgres
After some changes on my DB I notice that where I used to have a large pg_toast_X table, I now have a large pg_largeobject table. Can't find an explanation of the difference between the two, could someone enlighten me?

Re: [GENERAL] pg_largeobject vs pg_toast_XXXX

2011-08-02 Thread bubba postgres
No takers? Some background I've changed my TOAST type from EXTENDED to MAIN. On Thu, Jul 28, 2011 at 10:50 AM, bubba postgres wrote: > > After some changes on my DB I notice that where I used to have a large > pg_toast_X table, I now have a large pg_largeobject table. &

[GENERAL] Indicating DEFAULT values in INSERT statement

2011-08-09 Thread Postgres User
Hi, According to the docs, the DEFAULT keyword lets you explicitly insert a field's default value in an INSERT statement. >From a db function, I'd like to force the use of default when an input parameter is null. This syntax looks correct but fails to compile. Any suggestions? INSERT INTO publ

Re: [GENERAL] Indicating DEFAULT values in INSERT statement

2011-08-09 Thread Postgres User
Thanks for the previous posts. I am in fact running 9.0 'nix and am unable to find a way to embed DEFAULT within an expression. I can always rewrite the function to call EXECUTE but that's not a very good solution in this case because many of our db functions are code generated. On Tue, Aug 9, 201

Re: [GENERAL] Indicating DEFAULT values in INSERT statement

2011-08-09 Thread Postgres User
Good idea but you're right, if the default value is an expression such as a the next serial value, it will need to be executed first. If Execute doesn't return the interpreted value, I don't know of a way to make it work.. On Tue, Aug 9, 2011 at 5:35 PM, Diego Augusto Molina < diegoaugustomol...@

[GENERAL] Storing large files in multiple schemas: BLOB or BYTEA

2012-10-10 Thread tigran2-postgres
Hi, I need to store large files (from several MB to 1GB) in Postgres database. The database has multiple schemas. It looks like Postgres has 2 options to store large objects: LOB and BYTEA. However we seem to hit problems with each of these options. 1. LOB. This works almost ideal, can

Re: [GENERAL] Storing large files in multiple schemas: BLOB or BYTEA

2012-10-10 Thread tigran2-postgres
>Large Objects and bytea are the only ways. > >If you want to pg_dump only certain large objects, that won't work as far as I know (maybe using permissions and a non-superuser can help). > >You absolutely need to pg_dump parts of the database regularly? > >Yours, >Laurenz Albe It is n

Re: [GENERAL] Storing large files in multiple schemas: BLOB or BYTEA

2012-10-10 Thread tigran2-postgres
Using files stored outside the database creates all sorts of problems. For starters you lose ACID guaranties. I would prefer to keep them in database. We did a lot of experiments with Large Objects and they really worked fine (stored hundreds of LOBs ranging from a few MB up to 1GB). Postgres does a re

[GENERAL] Storing large files in multiple schemas: BLOB or BYTEA

2012-10-10 Thread tigran2-postgres
>Yeah, a pg_dump mode that dumped everything but large objects would be nice. There is option -b for pg_dump which controls whether large objects are dumped or no. The problem is that with option -b it dumps all large objects regardless of what schema you requested it to dump using option -n. Othe

[GENERAL] Max array size

2008-06-30 Thread Postgres User
Hi, Does anyone know the maximum number of elements allowed in a one-dimensional array? It looks like my script may add at least a couple million, not sure if it will hit a limit... -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http:

[GENERAL] Postgres database performance on 6 core Opteron vs 4 core Xeon

2009-11-25 Thread Postgres User
Has anyone seen any performance metrics comparing the Opteron 6-core Istanbul class processor aginst the 4-core Xeon e5500 series processor, esp running a dataase? Or has anyone compared these 2 processor options before ordering a Postgres server? The 6 core processor should offer a clear edge

[GENERAL] Postgres database performance on 6 core Opteron vs 4 core Xeon

2009-11-25 Thread Postgres User
Has anyone seen any performance metrics comparing the Opteron 6-core Istanbul class processor aginst the 4-core Xeon e5500 series processor, esp running a dataase?  Or has anyone compared these 2 processor options before ordering a Postgres server? The 6 core processor should offer a clear edge

[GENERAL] How to check status of bug (42804: structure of query does not match error where using RETURN QUERY) ?

2009-12-06 Thread Postgres User
Hi, I've encountered a serious Postgres bug which apparently has a fix that hasn't been released in a patch. How or where can I look up its status? This is a serious bug- it basically renders RETURN QUERY useless in any environment where you don't have the option of dropping an

[GENERAL] Selecting from table into an array var

2009-12-18 Thread Postgres User
Hi, I'm trying to write a very simple function statement to select a single integer field from a table and save it into an int array. For some reason I can't seem to find the correct syntax: CREATE TABLE sample ( id integer ); and then within a function: my_array int[]; my_array = SELECT A

Re: [GENERAL] Selecting from table into an array var

2009-12-18 Thread Postgres User
On Fri, Dec 18, 2009 at 9:53 PM, Merlin Moncure wrote: > On Fri, Dec 18, 2009 at 11:35 PM, Pavel Stehule > wrote: >> 2009/12/19 Postgres User : >>> Hi, >>> >>> I'm trying to write a very simple function statement to select a >>> single int

Re: [GENERAL] Selecting from table into an array var

2009-12-19 Thread Postgres User
On Sat, Dec 19, 2009 at 6:56 AM, Merlin Moncure wrote: > On Sat, Dec 19, 2009 at 1:05 AM, Postgres User > wrote: >> >> BEGIN >> SELECT array_agg(category_id) INTO cat_list FROM ( >>         WITH RECURSIVE subcategory AS >>                ( >

[GENERAL] How to call a function that returns a refcursor ?

2009-12-19 Thread Postgres User
Hi, I have a function that returns a refcursor that I need to call from a second function. In the second function, I'd like to read a column value from each row. However, I'm having a problem accessing the rows of the refcursor. Can anyone point me to a working example of how to pull this off?

Re: [GENERAL] Selecting from table into an array var

2009-12-19 Thread Postgres User
Great call, someone did hose the data. Oddly enough the circular reference caused no problem when running the stand alone recursive SQL (with clause). On Sat, Dec 19, 2009 at 10:41 AM, Merlin Moncure wrote: > On Sat, Dec 19, 2009 at 1:30 PM, Postgres User > wrote: >> >> T

[GENERAL] How to restore a SQL-ASCII encoded database to a new UTF-8 db?

2009-05-21 Thread Postgres User
Hi, I have a database that was created with SQL-ASCII encoding (unfortunately). I ran pg_restore to load the struct and data into a new database with UTF-8 encoding but no surprise- I'm seeing this error for a number of tables: pg_restore: [archiver (db)] COPY failed: ERROR: invalid byte sequen

[GENERAL] Which query is less expensive / faster?

2005-02-24 Thread Postgres Coder
Hi all, I have a couple different ways to get results out of my table structure, but I'm unsure which way is faster or less expensive to run: Option 1: Query a table of 4 million rows, on 4 indexed columns. It will return 1 row: SELECT field1, field2, field3, field4 FROM tablea WHERE field1 =

[GENERAL] PITR restore hot standby

2005-05-23 Thread Postgres General
uot; them on the secondary one. I have stopped postgres, recreated "recovery.conf", started postgres and I get the following error: LOG: database system was shut down at 2005-05-23 05:19:34 PDT LOG: starting archive rec

[GENERAL] Fun with Cursors- how to rewind a cursor

2007-03-01 Thread Postgres User
Hi, I'm opening a refcursor in Postgres to return a dataset to the client. However, before returning the cursor, I'd like to iterate thru the rows. Here's the code: DECLARE ref_entry refcursor; rec record; i integer = 0; v_list varchar = ''; BEG

Re: [GENERAL] Fun with Cursors- how to rewind a cursor

2007-03-01 Thread Postgres User
Thanks for the pointer. According to the Postgres docs: "The portal name used for a cursor can be specified by the programmer or automatically generated. To specify a portal name, simply assign a string to the refcursor variable before opening it." So I added the foll

Re: [GENERAL] Add items to a record variable

2007-03-01 Thread Postgres User
If you need to return a record to another function or client program, you can always use this sytnax: SELECT var_a::integer, var_b::integer, var_c::integer... etc where var_a, var_b, etc and local variables that hold your calculated values. You dont need to create a local record structure- sele

Re: [GENERAL] Fun with Cursors- how to rewind a cursor

2007-03-01 Thread Postgres User
I had tried several variations of MOVE Backward inside an Execute statement earlier. And now, I'm seeing this error appear again: ERROR: 0A000: cannot manipulate cursors directly in PL/pgSQL I updated the Postgres function below with this replacement line: Execute 'MOVE Backward All

Re: [GENERAL] Add items to a record variable

2007-03-01 Thread Postgres User
select mt.fieldlist ' || new_fields || ' from mytable mt into rec2'; end; This is a hack but it should work. You'll end up with a single record var with your old fields and new fields, typed as you have specified. On 3/1/07, Eddy D. Sanchez <[EMAIL PROTECTED]> wrote: Good

[GENERAL] How to capture and handle failed INSERT

2007-03-04 Thread Postgres User
Hi, I'm using this code to increment a counter table: IF Exists (SELECT keyfld FROM counter_tbl WHERE key_fld = 'key_val') THEN UPDATE counter_tbl SET counter_fld = counter_fld + 1 WHERE key_fld = 'key_val'; ELSE INSERT INTO counter_tbl(key_fld, counter_fld) VALUES('key_val', 1)

Re: [GENERAL] How to capture and handle failed INSERT

2007-03-04 Thread Postgres User
wrote: Postgres User wrote: > I'm using this code to increment a counter table: > > IF Exists (SELECT keyfld FROM counter_tbl WHERE key_fld = 'key_val') THEN >UPDATE counter_tbl SET counter_fld = counter_fld + 1 > WHERE key_fld = 'key_val'; > ELSE

Re: [GENERAL] newid() in postgres

2007-04-04 Thread Postgres User
Marcel, A sequence represents a unique identifier. You can call the function 'nextval' to get the next unique value in the sequence. See related functions here: http://www.postgresql.org/docs/8.2/interactive/functions-sequence.html In this code, I get the next sequence, insert it into a table,

Re: [GENERAL] Need your help on using "partion"

2007-04-04 Thread Postgres User
e the partion in Postgres 8.2.3 so I want to do some test for my awareness. I create 2 tables: The parent table is cities:*/ CREATE TABLE xxx.cities ( id serial NOT NULL, name text, population real, altitude integer, CONSTRAINT pk_cities PRIMARY KEY (id) ) /*and a partion of cities is capital

Re: [GENERAL] Storing blobs in PG DB

2007-04-04 Thread Postgres User
I recently heard from Josh Berkus that at least one major CMS application uses Postgres to store entire HTML pages (including image files) in order to support full versioning. As a general rule, I prefer not to store BLOBS in a DB- I'd rather leave the BLOB in the file system and let the db

Re: [GENERAL] Using MS Access front-end with PG]

2007-04-04 Thread Postgres User
Oleg, This looks like a great module, do you have a pointer to it in English? If can send this module to me as a compressed file, I'll take the time to post it on PgFoundry as a new project that everyone can easily access and download. Paul- if you go with the lower() edits route, be sure to no

[GENERAL] Granting permissions

2007-04-04 Thread Postgres User
Is there a way to grant INSERT and UPDATE permissions on all the tables in a database? I don't want to type-in every table name... ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Using C# to create stored procedures

2007-04-05 Thread Postgres User
Andrus, As a C# developer myself, I'd recommend learning pl/pg sql for writring stored procs. It's designed specifically for the kinds of iterations and other operations you need when hanlding a recordset. It's nothing like transact-sql of SQL Server. If you must have full C# integration, then

Re: [GENERAL] newid() in postgres

2007-04-07 Thread Postgres User
You'll need to create a custom function in Postgres to support this, which is fairly easy. It's been done before- do a search on Google: http://www.hclausen.net/psql.php On 5 Apr 2007 01:27:15 -0700, marcel.beutner <[EMAIL PROTECTED]> wrote: Hello, Thanks a lot for your answ

[GENERAL] Change encoding of SQL_ASCII database with multibyte chars?

2004-11-13 Thread leon-postgres
Hello, there! I recently migrated a medium-sized db from SQL Server to postgres. A couple months after the migration, I noticed I was having some problems retrieving some data via the JDBC driver. The problem turned out to be multi-byte characters (smart quotes, etc) in the SQL_ASCII database

[GENERAL] Fwd: 8.0 vs. 7.4 benchmarks

2004-12-07 Thread Postgres Learner
Hi all! I posted this on pgsql-performance but got no reply, so here it is: thanks! ps -- Forwarded message -- From: Postgres Learner <[EMAIL PROTECTED]> Date: Mon, 6 Dec 2004 14:58:46 +0530 Subject: 8.0 vs. 7.4 benchmarks To: [EMAIL PROTECTED] Hi all! Has anyone do

[GENERAL] weird run-times with pg_autovacuum

2004-12-20 Thread Postgres Learner
table with ~90k rows at one such time of weird behavior(they ran for a long long time). Is it possible that pg_autovacuum is auto vacuuming that same table at that time and there is some unnecessary waiting involved because the table is locked? I am a complete newbie to postgres and I am throwing dar

Re: [GENERAL] weird run-times with pg_autovacuum

2004-12-22 Thread Postgres Learner
Hi All! I tried to find out more details about this weird problem, and I must say, I am stumped. here are the details: We run a software module on a 64-bit opteron with a 32 Gig RAM, RedHat AS3 update 3, Linux 2.4.21. postgres 7.4.6 I dumped the postgres query logs and here are the numbers

[GENERAL] disable trigger from transaction

2005-01-24 Thread Postgres General
hello, I am interested in disabling a trigger from a transaction. I am not want to disable the trigger globally but only for the current transaction. Can I do it somehow ? thanks, Razvan Radu ---(end of broadcast)--- TIP 5: Have you checked our exte

[GENERAL] Installing Postgres 8.1 on Windows Server 2003 R2

2006-01-07 Thread Postgres User
Hi,   Has anyone tried to install Postgres on Windows Sever 2003 version R2?  R2 is actually shipping as a 'new' Microsoft product- it's basically an interim update to Windows Server ( http://www.microsoft.com/windowsserver2003/r2/whatsnewinr2.mspx).   I've installed Postgres

Re: [GENERAL] Installing Postgres 8.1 on Windows Server 2003 R2

2006-01-08 Thread Postgres User
That's what I was afraid of... it's a new install of Win Server 2003 R2, so I can rule out any third party firewall. Windows Firewall is NOT installed.  And I've installed Postgres on a Windows XP box behind the same router, so it's not a router-firewall issue.   It's

[GENERAL] filesystem option tuning

2004-05-16 Thread share-postgres
Hi All, I have recently started evaluating Postgresql 7.4.2 to replace some *cough* more proprietary database systems... Thanks to the _excellent_ documentation (a point I cannot overemphasize) I was up and running in no time, and got a first test application running on the native C interface. Th

Re: [GENERAL] Case insensitive "contains" search

1998-11-09 Thread Postgres DBA
hi! I'm not shure that syntax you have used is correct, I mean that better is: select * from tablex where name LIKE '%test%'; or you can also try "~~" operator that is used in Postgres as synonym to "LIKE": select * from tablex where name ~~ '%test%&#x

[GENERAL] cyrillic recode support

1998-11-13 Thread Postgres DBA
Hi All! Compiling Postgres-6.4 I came accross following option in ./configure script: " --enable-recode enable cyrillic recode support" What is it for ? I wonder if it's intended to add capability of translation between koi8 and win-1251 encofing, but I was unable to find

RE: [GENERAL] problem of upper/lower case in table names

1998-11-18 Thread Postgres DBA
On Tue, 17 Nov 1998, Taral wrote: > > >i've got this annoying problem : if you create a table with an uppercase > > >name, postgres transforms it in lower case. After that, if you try to > > >retrieve the primary keys for this table ( still using the uppercase &

[GENERAL] dying backend processes

1999-05-05 Thread postgres admin
Hi all, we are using Postgresql 6.4.2 on FreeBSD 2.2.8 and have a lot of problems with suddenly dying backend processes. We have already changed kernel parameters to get more shared memory and start the postmaster with -B 1024. The postmaster's virtual memory limit is currently 300MByte and our l

Re: [GENERAL] Restore problem

2010-12-29 Thread Tim Bruce - Postgres
On Wed, December 29, 2010 10:59, John R Pierce wrote: > On 12/29/10 4:34 AM, Leif Biberg Kristensen wrote: >> Back when I used Windows, my favorite editor was EditPlus >> (http://www.editplus.com/). It isn't free, but well worth the 35 bucks. > > other good choices are Notepad++ (free) and my perso

Re: [GENERAL] How to speed up the first-time-searching in pgsql?

2009-05-28 Thread Tim Bruce - Postgres
On Thu, May 28, 2009 01:23, Richard Huxton wrote: > zxo102 ouyang wrote: >> Hi there, >> Thanks for your suggestions. I do have an application running on the >> machine >> all the time. In fact, the application keeps writing real-time >> monitoring >> data into the database. Based on my understandi

Re: [GENERAL] High I/O writes activity on disks causing images on browser to lag and not load

2009-06-03 Thread Tim Bruce - Postgres
On Wed, June 3, 2009 12:59, Bill Moran wrote: > In response to Jennifer Trey : > >> Hmm, I just noticed the same write behavior on my Windows Xp laptop but >> the >> values was a little less. >> I even created an DB with one table and column and this still happened >> when querying it. > > By "cre

Re: [GENERAL] High I/O writes activity on disks causing images on browser to lag and not load

2009-06-03 Thread Tim Bruce - Postgres
On Wed, June 3, 2009 13:44, Jennifer Trey wrote: > On Wed, Jun 3, 2009 at 10:59 PM, Bill Moran > wrote: > >> In response to Jennifer Trey : >> >> > Hmm, I just noticed the same write behavior on my Windows Xp laptop >> but >> the >> > values was a little less. >> > I even created an DB with one tab

Re: [GENERAL] interface for "non-SQL people"

2009-10-09 Thread Tim Bruce - Postgres
On Fri, October 9, 2009 09:06, Andrew Gould wrote: > On Fri, Oct 9, 2009 at 10:15 AM, Joshua D. Drake > wrote: >> On Thu, 2009-10-08 at 19:16 -0600, Scott Marlowe wrote: >>> On Thu, Oct 8, 2009 at 2:22 PM, Merlin Moncure >>> wrote: >>> > >>> > The #1 tool you have at your disposal is the human br

Re: [GENERAL] How to know the password for the user 'postgres'

2008-10-28 Thread Tim Bruce - Postgres
On Tue, October 28, 2008 05:57, Tom Lane wrote: > Sam Mason <[EMAIL PROTECTED]> writes: >> On Tue, Oct 28, 2008 at 10:42:47AM +0100, Thomas wrote: >>> An easy trick I have found to set postgres password: $ sudo passwd >>> postgres, and now you can type a ne

Re: [GENERAL] Questions on PostGreSQL Authentication mechanism...

2010-02-02 Thread Tim Bruce - Postgres
general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > Since the pg_hba.conf file is located in the /etc path, the pg_read_file command fails with an error of "could not open file "pg_hba.con

Re: [GENERAL] Who is locking me?

2010-03-18 Thread Tim Bruce - Postgres
On Thu, March 18, 2010 12:29, Bill Moran wrote: > In response to "Abraham, Danny" : > >> Hi, >> >> >> >> A process hangs forever. >> >> When using this query... >> >> >> >> SELECT pg_stat_get_backend_pid(s.backendid) AS procpid, >> >>pg_stat_get_backend_activity(s.backendid) AS current_que

Re: [GENERAL] Looking for advice on database encryption

2009-04-16 Thread Tim Bruce - Postgres
On Thu, April 16, 2009 13:20, Bill Moran wrote: > In response to Thomas Kellerer : > >> Bill Moran wrote on 16.04.2009 21:40: >> > The goal here is that if we're going to encrypt the data, it should >> > be encrypted in such a way that if an attacker gets ahold of a dump >> > of the database, they

[GENERAL] Client for postgres help!!

1999-12-30 Thread postgres sql freeware
Hi!! Somebody can help me!!!??? :) Where can i get information about how to use the client for win32??? i wanna use it with Delphi or some stuff like that very much thanks __ Get Your Private, Free Email at http://www.hotmail.com ***

Re: [GENERAL] Restoring a database from a file system snapshot

2008-08-27 Thread postgres Emanuel CALVO FRANCO
Sorry Alvaro, i sent to you the message ;P Is the same way (from snapshot) that use Mysql on ZFS. IF you don't change anything in the database, why it don't works? Then you restart the service with the same path. The problem it will be that you need to stop postgres BEFORE snapshot.

Re: [GENERAL] [HACKERS] PostgreSQL future ideas

2008-09-29 Thread postgres Emanuel CALVO FRANCO
2008/9/27 Douglas McNaught <[EMAIL PROTECTED]>: > On Sat, Sep 27, 2008 at 12:13 PM, Mark Mielke <[EMAIL PROTECTED]> wrote: >> If >> some parts of PostgreSQL are not performance bottlenecks, and they are >> extremely complicated to write in C, and very easy to write in something >> else common and s

Re: [GENERAL] Opteron vs. Xeon performance differences

2008-10-10 Thread postgres Emanuel CALVO FRANCO
How do you manage the wal in both servers? The version kernel is the same in both? Runs the same services? Do you make some test with Posgresql only in both servers? If the problem is the inter-CPU, i know you can specified the number of processors do you want to run dedicated to one process. 200

Re: [GENERAL] Opteron vs. Xeon performance differences

2008-10-10 Thread postgres Emanuel CALVO FRANCO
n the new. In that way could be a configuration kernel. do you make a test of hardware instead postgres?? if the hard give you better numbers, so postgres have the problem. 2008/10/10 Shane Ambler <[EMAIL PROTECTED]>: > Bart Grantham wrote: >> >> a long story short: we&#

Re: [GENERAL] databases list to file

2008-10-14 Thread postgres Emanuel CALVO FRANCO
is from a shell script to be executed without human >> intervention >> >> I guess something like: >> >> su postgres -c 'psql ...whatever > /tmp/my_databases.txt' >> >> but I don't know exactly to what extent I can format the output of this

Re: [GENERAL] How to free disk space

2008-10-21 Thread postgres Emanuel CALVO FRANCO
erforming a VACCUM FULL? It locks the database for several > hours, and that is not a solution. > > I guess a backup-restore would do the work but, isn't there a better way to > do this without shutting down postgres? > > Thanks in advandce. > > --

Re: [GENERAL] Replication with slony-I

2008-10-27 Thread postgres Emanuel CALVO FRANCO
http://slony.blogspot.com/ sorry is in spanish, but is an exelent resource, i hope it will be useful reggards 2008/10/27 Abdul Rahman <[EMAIL PROTECTED]>: > May any one support step by step procedure for the replication with slony-I > in windows xp. > > -- Emanuel Calvo Franco Sysc

Re: [GENERAL] PostgreSQL 8.3.4 Solaris x86 compilation issues

2008-11-01 Thread postgres Emanuel CALVO FRANCO
do you just read FAQ_Solaris in the docs. I don't remember at all, but is explain some steps to run with SSL. 2008/11/1, Zdenek Kotala <[EMAIL PROTECTED]>: > Hi, > > It is really strange. Is there any reason why you don't use integrated SSL? > 64bit version is located in /usr/sfw/lib/64 > Try > >

[GENERAL] no port support in pg_ctl?

2001-01-25 Thread Mailing Lists for Postgres
To answer the question "why?".. I'm wanting to run multiple independent database sessions of Postgresql on the same machine. I thought I'd just copy pgsql.sh startup scripts and add the -D option to specifiy different database locations and -p option to specify different tcp port numbers. Howeve

<    1   2