[GENERAL] Deleting PostGres ID Under Windows XP?

2012-04-28 Thread PostGres
Somewhere along the line the install of one of my apps created a userid named "PostGres", I assume in connection with installing the PostGres database manager. Now I no longer have the option of having the system just boot up into my own ID: I have to select my ID from a login s

Re: [GENERAL] Deleting PostGres ID Under Windows XP?

2012-04-28 Thread PostGres
RE/ >> Am I going to regret doing this? > >If you want to keep using Postgres, yes. Search the web Suspicion.. *Confirmed*. Thanks! -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/ma

[GENERAL] Getting data out of DB with bad WAL files.

2001-08-28 Thread postgres
Hi, I've got a DB where the WAL files were lost. I know I've lost some data, but is there anyway to get what is in the primary DB back out again? PG won't start with bad WAL files so...:( Thanks for the help. GB -- GB Clark II | Roaming FreeBSD Admin [EMAIL PROTECTED] | Genera

Re: [GENERAL] Questions about tuning on FreeBSD...

2001-09-10 Thread postgres
On Monday 10 September 2001 18:52, Philip Hallstrom wrote: > Hi all - > I have some questions about tuning the various kernel parameters > on FreeBSD. I've read Bruce's article a couple of times and the various > parts of the documentation, but I still have some questions and was hoping > p

[GENERAL] Re: Auto Increment

2000-12-27 Thread postgres
I had looked everywhere to find the answer to this question. Now that I look at the FAQ again I see it in there. I tryed searching the FAQ for "auto increment" when it turns out to be "auto-increment" on the FAQs page. Being a MySQL user who was dead ended and had no choice but to find a new d

[GENERAL] [Question] Help me with programming in C/C++

1998-10-04 Thread postgres
Hi.   I have a question regarding programming in C and postgreSQL.   Is there any way that I can save couple of results to one PGresult * ??   Like thisBEGIN;DECLARE portal1 CURSOR FOR select * from item where item = 'aa';DECLARE portal2 CURSOR FOR select * from item

[GENERAL] [Question] Help me with programming in C/C++

1998-10-05 Thread postgres
ds like "Search Engine" My program will separate each token.. and postgres will search like as below.. Something Like this BEGIN; DECLARE portal1 CURSOR FOR select * from db where description ~* '^search engine$'; DECLARE portal2 CURSOR FOR select * f

No Subject

1998-07-23 Thread Postgres
Hi all How can i put limited length varchar(20) to SQL function? I have: create table bb ( c varchar(20), d int4 ); create function ins ( ???varchar???, int4) returns int4 as 'insert into bb (c, d) values ($1, $2); select 1; ' la

Re: [GENERAL] users in Postgresql

1999-11-03 Thread postgres
>> The contents of the pg_shadow table are written through to a file on disk >> called pg_pwd, so all the backends can easily access it. However, this >> write through is not automatic. The create user and alter user commands >> take care of that, but if you update pg_shadow directly, your changes

RE: [GENERAL] Announce: Postgres Access Control Tool

1999-12-21 Thread postgres
d object files: libpgtcl.so - Tcl/Tk Postgres interface libtix.so - widget frameset On Windows this files are LIBPGTCL.DLL and LIBTIX.DLL. The first is part of Postgres and the second can be downloaded from ftp://www.neosoft.com/pub/tcl/sorted/packages-7.6/unknown/tixwin41p6bin.zip You have to edit the P

[GENERAL] Building PL/Perl procedural language without --with-perl configure flag

2017-01-15 Thread postgres user
Hi, I am trying to build PL/Perl procedural language to my PostgreSQL server installation but I want to do it without passing --with-perl flag to the configure script of PostgreSQL. It would also help if someone can explain the meaning of --with-perl flag in a detailed fashion altogether as it mig

[GENERAL] Re: Building PL/Perl procedural language without --with-perl configure flag

2017-01-15 Thread postgres user
The already installed Postgres edition was built using the same installation procedure as mentioned in the docs, but without the use of --with-perl flag. the point I ask the question is because I want to install PL/Perl as a separate extension as one does with PostGIS and not along with Postgres

[GENERAL] Making changes to PostgreSQL's configure logic so as to have contrib modules installed in a specific directory and make them use PGXS?

2017-01-31 Thread postgres user
Hi, I want to configure my PostgreSQL installation in such a manner such that the contrib modules of the PostgreSQL distribution are stored in a specific directory and they should use the PGXS extensions management system supported by Postgres, as they are currently packaged along with Postgres

[GENERAL] Testing an extension exhaustively?

2017-02-01 Thread postgres user
Hi, If I have the Postgresql server installed on my machine i.e I have all the bins, libs and share directories of the Postgresql and I have the libs and sql's installed for one of the contrib extensions lets say "chkpass", how does one go about testing this extension exhaustively on the server? I

[GENERAL] Using different GCC, CFLAGS, CCFLAGS and CPPFLAGS to compile Postgres and PostGIS?

2017-02-01 Thread postgres user
Hi, I am wondering about this question for a while with no definite answer to it, can someone explain me in detail to clear me out on the following question : What can go wrong or is it acceptable if I build Postgres from source with let's say GCC 4.x.y and some specific CFLAGS, CPPFLAG

[GENERAL] Re: Using different GCC, CFLAGS, CCFLAGS and CPPFLAGS to compile Postgres and PostGIS?

2017-02-01 Thread postgres user
Also can you explain if I built Postgres from source on one platform lets say RHEL_6 and deployed its artifacts like its binaries, libs and share on a CentOS and tried building extensions against Postgres on CentOS are there any dangers of doing that? On Wed, Feb 1, 2017 at 8:34 PM, postgres user

[GENERAL] Do Postgres exceptions rise up the stack?

2007-06-30 Thread Postgres User
A basic question about raising exceptions in Postgres: If Function A calls Function B and Func B raises an exception, will the exception roll back the transaction in Func A by default? Or do I need to trap and re-raise the exception in Func A? Thanks. ---(end of

Re: [GENERAL] SQL problem..

2007-06-30 Thread Postgres User
Your query won't work because there is no single Price associated with a range of dates. It doesn't make sense. Do you mean to select AVG(Price)? On 6/28/07, Bauhaus <[EMAIL PROTECTED]> wrote: Hello, I'm an Access/SQL novice and I have an sql problem: I have the following table Price: FuelI

Re: [GENERAL] Do Postgres exceptions rise up the stack?

2007-06-30 Thread Postgres User
/30/07, Wiebe Cazemier <[EMAIL PROTECTED]> wrote: On Saturday 30 June 2007 23:14, Postgres User wrote: > A basic question about raising exceptions in Postgres: > > If Function A calls Function B > > and Func B raises an exception, will the exception roll back the > transact

Re: [GENERAL] Do Postgres exceptions rise up the stack?

2007-06-30 Thread Postgres User
Where func A, B, C, and D all update the db. If an EXCEPTION is raised in func D(), will all the transactions in the other children be rolled back? Or do I need to add code to enable this? On 6/30/07, Postgres User <[EMAIL PROTECTED]> wrote: How about this scenario: func A() beg

[GENERAL] General search problem - challenge

2007-07-02 Thread Postgres User
I have a table of around 6,000 places in the world. Everytime my server receives a ping, I'm grabbing the content of an article from an RSS feed. Then I search the article for the presence of any the 6000 terms. A typical article is around 1200 words. I don't need to save the article in a table

[GENERAL] Fastest way to join materalized view to child tables

2007-07-09 Thread Postgres User
arate tables and trying to correlate and sort the results. materialized view - view_a child tables - table_a, table_b, table_c Here's my question- what's the fastest what to retrieve rows from each of the child tables after I get results from view_a ? I don't like using tem

[GENERAL] How to join materalized view to child tables

2007-07-09 Thread Postgres User
arate tables and trying to correlate and sort the results. materialized view - view_a child tables - table_a, table_b, table_c Here's my question- what's the fastest what to retrieve rows from each of the child tables after I get results from view_a ? I don't like using tem

[GENERAL] How to extract a substring using Regex

2007-08-23 Thread Postgres User
Hi, I'm new to Regex in Postgres. Can someone give me a quick pointer on how I'd SELECT the substring between ''and '' in a field? Sample field data: address city here Rogers, Jim zip code place and I'd like the SELECT

Re: [GENERAL] How to extract a substring using Regex

2007-08-23 Thread Postgres User
Yes, I read the manual. I think I had a problem because of the special chars (< / >) that I'm trying to search for... Still looking for the right syntax. On 8/23/07, Michael Glaesemann <[EMAIL PROTECTED]> wrote: > > On Aug 23, 2007, at 19:33 , Postgres User wrote: &g

Re: [GENERAL] How to extract a substring using Regex

2007-08-23 Thread Postgres User
> > Yes, I read the manual. I think I had a problem because of the > > special chars (< / >) that I'm trying to search for... Still looking > > for the right syntax. > > Why don't you show us what you've tried and the errors you're > getting? That way we can help you figure out what you're doing

[GENERAL] Simple Regex question, hoping for direct answer (no Socratic approach necessary)

2007-08-23 Thread Postgres User
I'm new to Regex in Postgres. Can someone give me a quick pointer on how I'd SELECT the substring between ''and '' in a field? Sample field data: address city here Rogers, Jim zip code place and I'd like the SELECT to return only: Rogers, Jim Thanks!

Re: [GENERAL] How to extract a substring using Regex

2007-08-23 Thread Postgres User
On 8/23/07, Michael Glaesemann <[EMAIL PROTECTED]> wrote: > > On Aug 23, 2007, at 20:01 , Postgres User wrote: > > >>> Yes, I read the manual. I think I had a problem because of the > >>> special chars (< / >) that I'm trying to search for.

[GENERAL] public schema doubt

2007-11-16 Thread mailtolouis2020-postgres
ublic schema for me. So why it doing this for me? I thought it should restore back excatly the same what I backup from 8.2.4? Should I just let the public schema there? Will it cause any problem? In the postgres doc http://www.postgresql.org/docs/8.2/interactive/ddl-schemas.html (5.7.2) it said

Re: [GENERAL] public schema doubt

2007-11-16 Thread mailtolouis2020-postgres
ropped when I create the db, so only myschema is there), but when I restore to 8.2.5, I found that it created a public schema for me. So why it doing this for me? I thought it should restore back excatly the same what I backup from 8.2.4? Should I just let the public schema there? Will it cause an

[GENERAL] Postgres file structure doubt

2007-11-19 Thread mailtolouis2020-postgres
Hi everyone, Got a doubt in my setup, please correct me if I'm wrong. In my postgres setup, /usr/local/pgsql (where postgres install) /usr/local/pgsql/data (PGDATA) /database/pg/mydata (tablespace which use for all the table I create) /database/pg/myindex (index which use for all the ta

Re: [GENERAL] Postgres file structure doubt

2007-11-20 Thread mailtolouis2020-postgres
Hello Scott, Thanks for clear my doubt. Yes, I'm planning to do PITR backup. Another question, from what I understand, when there are data transaction going on, postgres will store in the log file, which is in /usr/local/pgsql/data/pg_xlog, when these data will finally save it into /dat

[GENERAL] Simple math statement - problem

2007-11-29 Thread Postgres User
ast(1 / 100 As decimal) select Cast(1 / 100 As numeric(6,2)) How can I write statements that returns a decimal? The problem doesn't appear to be that Postgres won't return decimal values, as these statements return the correct value: select .01 select Cast(.01 As decimal)

Re: [GENERAL] Record variable not behaving as expected (bug?)

2007-11-30 Thread Postgres User
--- 0 Hopefully someone can test on Windows to validate. On Nov 30, 2007 8:25 AM, Martijn van Oosterhout <[EMAIL PROTECTED]> wrote: > On Fri, Nov 30, 2007 at 08:20:30AM -0800, Postgres User wrote: > > tom- did you test this on wndows? you can ignore the namespace- i'm

Re: [GENERAL] Record variable not behaving as expected (bug?)

2007-11-30 Thread Postgres User
ECTED]> wrote: > Martijn van Oosterhout <[EMAIL PROTECTED]> writes: > > On Fri, Nov 30, 2007 at 12:23:31AM -0800, Postgres User wrote: > >> However, I have found that my record variable is not assigned proper > >> field-level datatypes. As a result, I'm unable to

[GENERAL] Record variable not behaving as expected (bug?)

2007-11-30 Thread Postgres User
According to the docs, record variables "take on the actual row structure of the row they are assigned during a SELECT or FOR command." However, I have found that my record variable is not assigned proper field-level datatypes. As a result, I'm unable to write basic math calcs in pg/sql without a

Re: [GENERAL] Simple math statement - problem

2007-11-30 Thread Postgres User
t; > > > -Original Message- > From: [EMAIL PROTECTED] on behalf of Gregory Williamson > Sent: Thu 11/29/2007 10:37 PM > To: Postgres User; pgsql-general > Subject: Re: [GENERAL] Simple math statement - problem > > The question: > > > &

Re: [GENERAL] Record variable not behaving as expected (bug?)

2007-11-30 Thread Postgres User
$body$ LANGUAGE 'plpgsql'; On Nov 30, 2007 12:31 PM, Postgres User <[EMAIL PROTECTED]> wrote: > Sure, I'd be glad to provide any additional code or info that I can. > This issue took me quite awhile to track down from the 200-line > function that was breaking. &g

Re: [GENERAL] Record variable not behaving as expected (bug?)

2007-11-30 Thread Postgres User
8.2 / Windows (a development-only pc) On Nov 30, 2007 12:50 AM, Martijn van Oosterhout <[EMAIL PROTECTED]> wrote: > On Fri, Nov 30, 2007 at 12:23:31AM -0800, Postgres User wrote: > > However, I have found that my record variable is not assigned proper > > field-level da

[GENERAL] Abusing Postgres in fun ways.

2010-12-07 Thread bubba postgres
I'm creating a data queue on top of postgres and I'm wondering if I've made an incorrect assumption about isolation or synchronization or some similar issue. Every item in the queue is given a unique ID from a sequence. CREATE TABLE data_queue ( sequence_num BIGINT PRIMARY KEY

[GENERAL] Abusing Postgres in interesting ways

2010-12-07 Thread bubba postgres
Hello all, I'm creating a data queue on top of postgres and I'm wondering if I've made an incorrect assumption about isolation or synchronization or some similar issue. Every item in the queue is given a unique ID from a sequence. CREATE TABLE data_queue ( sequence_num BIG

[GENERAL] Time Series on Postgres (HOWTO?)

2011-01-14 Thread bubba postgres
I've been googling, but haven't found a good answer to what I should do if I want to store time series in Postgres. My current solution is store serialized (compressed) blobs of data. (So for example store 1 day worth of 1 minute samples (~1440 samples) stored as one row in a bytea.

[GENERAL] missing chunk number (Bug 5507)

2011-01-16 Thread bubba postgres
I found this link: http://postgresql.1045698.n5.nabble.com/BUG-5507-missing-chunk-number-0-for-toast-value-X-in-pg-toast-X-td2126674.html And am also experiencing the same issue... More anecdotal evidence that this is a bug: We recently(couple days ago) completely recreated the DB, and sta

[GENERAL] Anyone use PG with kvm/virtio? Any gotchas or recommended settings?

2011-01-19 Thread bubba postgres
by crashes or restarts of postgres), and we are wondering if that might be the culprit.

[GENERAL] Is TimeZone applied with TIMESTAMP WITHOUT TIME ZONE and Extract( EPOCH ...)?

2011-03-17 Thread bubba postgres
I'm noticing some interesting behavior around timestamp and extract epoch, and it appears that I'm getting a timezone applied somewhere. Specifically, If I do: select EXTRACT( EPOCH FROM '2010-01-31 00:00:00'::TIMESTAMP WITHOUT TIME ZONE ); == 1264924800 select EXTRACT( EPOCH FROM '2010-04-01 00:0

[GENERAL] Re: Is TimeZone applied with TIMESTAMP WITHOUT TIME ZONE and Extract( EPOCH ...)?

2011-03-17 Thread bubba postgres
Looks like a quick search says I need to specify the timezone... On Thu, Mar 17, 2011 at 11:22 AM, bubba postgres wrote: > > I'm noticing some interesting behavior around timestamp and extract epoch, > and it appears that I'm getting a timezone applied somewhere. > &

[GENERAL] Re: Is TimeZone applied with TIMESTAMP WITHOUT TIME ZONE and Extract( EPOCH ...)?

2011-03-17 Thread bubba postgres
no.. still confused. I assume it's storing everythign in UTC.. did I need to specify a timezone when I inserted? On Thu, Mar 17, 2011 at 11:24 AM, bubba postgres wrote: > Looks like a quick search says I need to specify the timezone... > > > On Thu, Mar 17, 2011 at 11:22 A

[GENERAL] Re: Is TimeZone applied with TIMESTAMP WITHOUT TIME ZONE and Extract( EPOCH ...)?

2011-03-17 Thread bubba postgres
ok got it. select EXTRACT( EPOCH FROM '2010-04-01 00:00:00'::TIMESTAMP WITHOUT TIME ZONE at time zone 'utc' ); On Thu, Mar 17, 2011 at 11:32 AM, bubba postgres wrote: > no.. still confused. > I assume it's storing everythign in UTC.. did I need to speci

[GENERAL] why does extract ( HOUR FROM TIMESTAMP '2010-01-01 00:00:00' at time zone 'utc' ) == 16?

2011-03-17 Thread bubba postgres
Is this the correct behavior? It seems like if I specify the utc offset it should be 0, not 16.. It seems to be the opposite behavior from extract epoch. select extract ( HOUR FROM TIMESTAMP '2010-01-01 00:00:00' ) as defhour, extract ( HOUR FROM TIMESTAMP '2010-01-01 00:00:00' at time zone 'PST'

[GENERAL] Re: why does extract ( HOUR FROM TIMESTAMP '2010-01-01 00:00:00' at time zone 'utc' ) == 16?

2011-03-18 Thread bubba postgres
0-01-01 00:00:00' at time zone 'utc' ) at time zone 'utc' ) does not... Can anyone explain this? On Thu, Mar 17, 2011 at 5:05 PM, bubba postgres wrote: > Is this the correct behavior? It seems like if I specify the utc offset it > should be 0, not 16.. It seems to

[GENERAL] JDBC Binary transfer of Arrays

2011-03-31 Thread bubba postgres
Hello! In my current application I am sending a lot of data to/from the DB with JDBC, and specifically arrays of Double. (or even Double[][]). Alas, my current implementation I converts everything into a string representation, which blows my memory out of the water and drops my transaction rate way

Re: [GENERAL] JDBC Binary transfer of Arrays

2011-04-01 Thread bubba postgres
After trying out the JDBC4 driver in DBCP, I see that Connection.createArray(...) still just creates a big string under the covers. Is that the expected behavior? Am I doing it wrong? On Thu, Mar 31, 2011 at 8:04 PM, bubba postgres wrote: > Hello! > In my current application I am sending

[GENERAL] DBlink, postgres to DB2

2014-10-22 Thread Postgres India
Hi, I am trying to connect DB2 from postgres using dblink, is there any configuration required at DB2 and postgres server. If any command string please provide it. Thanks Manmohan. K

Re: [GENERAL] DBlink, postgres to DB2

2014-10-22 Thread Postgres India
Thanks a lot Remi, Merlin and Pavel...I will give it a try. On Wed, Oct 22, 2014 at 6:36 AM, Merlin Moncure wrote: > On Wed, Oct 22, 2014 at 5:56 AM, Pavel Stehule > wrote: > > Hi > > > > try to use a Perl implementation https://github.com/davidfetter/DBI-Link > > > > There is a DBD dri

Re: [GENERAL] DBlink, postgres to DB2

2014-10-30 Thread Postgres India
; http://multicorn.org/ > another cool stuff to generalize interconnections > > > Wed, 22 Oct 2014 22:34:06 -0700 от Postgres India : > > Thanks a lot Remi, Merlin and Pavel...I will give it a try. > > On Wed, Oct 22, 2014 at 6:36 AM, Merlin Moncure <https://e.mail.

[GENERAL] Active/Active clustering in postgres

2014-11-26 Thread Postgres India
Hi All, I am looking for PostgreSQL active/active clustering and whether PostgreSQL support any form of shared-storage clustering . Is there any methods or tools for implementing active/active clustering on Postgres supported by community or any third party tools. Regards Manmohan

[GENERAL] Regex query not using index

2008-02-19 Thread Postgres User
ing equity_eod_symbol_idx on equity_eod (cost=0.00..8.27 rows=1 width=149) Index Cond: ((symbol)::text = 'AA'::text) Is there any way to 'encourage' Postgres to hit the index when using regex? Do I need to create a functional index or something? Without the index in play,

Re: [GENERAL] Regex query not using index

2008-02-19 Thread Postgres User
Feb 19, 2008 8:45 PM, Erik Jones <[EMAIL PROTECTED]> wrote: > > On Feb 19, 2008, at 9:32 PM, Postgres User wrote: > > > I'm running a simple query on 8.2. With this syntax, Explain indicate > > that the index is scanned: > > select * from eod where name = &

Re: [GENERAL] Regex query not using index

2008-02-19 Thread Postgres User
where fielda ~ p_param (where p_param is the input parameter) On Feb 19, 2008 9:34 PM, Chris <[EMAIL PROTECTED]> wrote: > Postgres User wrote: > > Yes that works, but the whole point of the exercise is replace many OR > > statements with 1 regex expression. So it's not wha

Re: [GENERAL] Regex query not using index

2008-02-19 Thread Postgres User
Yes that works, but the whole point of the exercise is replace many OR statements with 1 regex expression. So it's not what I'm looking for. On Feb 19, 2008 9:16 PM, Chris <[EMAIL PROTECTED]> wrote: > Postgres User wrote: > > Thanks, my dumb mistake. > > I need

Re: [GENERAL] Regex query not using index

2008-02-19 Thread Postgres User
by the way, your example works fine unless it's a null value or empty string unfortunately, postgres isn't smart enough to know that the when p_param below is null, that the WHERE condition can be ignored select * from table where name in (Coalesce(p_param, name)) which is the same as

Re: [GENERAL] Regex query not using index

2008-02-19 Thread Postgres User
doh! tom, let me know if you decide to hack out a fix for this one of these nights ;) thanks for your help. On Feb 19, 2008 9:45 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Postgres User" <[EMAIL PROTECTED]> writes: > > Yes that works, but the whole point of

Re: [GENERAL] Regex query not using index

2008-02-20 Thread Postgres User
ignored by the optimizer- or am i missing something On Feb 19, 2008 9:45 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Postgres User" <[EMAIL PROTECTED]> writes: > > Yes that works, but the whole point of the exercise is replace many OR > > statements with 1 regex expr

Re: [GENERAL] Regex query not using index

2008-02-20 Thread Postgres User
ition equivalent to many OR conditions when using basic comparison operators: select * from table1 where name ~ '.*' '^Smith$' |^Jones$': And this works very well- except for the seq scan instead of an index scan On Feb 20, 2008 2:31 AM, Tino Wildenhain <[EMAIL P

Re: [GENERAL] Regex query not using index

2008-02-20 Thread Postgres User
value that Postgres will ignore when processing the query? This syntax results in a seq scan: WHERE fielda = Coalesce(param, fielda) because it applies only to non-nulls Is there another way to write this- perhaps using your array syntax on an empty array? Basically I'd PG to ignore the condi

[GENERAL] Trigger transactions

2008-03-21 Thread Postgres User
if a function includes this SQL: Update Table1 Set field_1 = 'ab'; Insert Table2(field_2) VALUES('cd'); and I create an update trigger on Table1: Create Trigger Table1_Update AFTER Update On Table1 FOR EACH ROW: Select * From Table2 will the Select statement in the trigger see the

Re: [GENERAL] Trigger transactions

2008-03-21 Thread Postgres User
Question answered- needed to move Insert statement before Update in main function. On Fri, Mar 21, 2008 at 6:42 PM, Postgres User <[EMAIL PROTECTED]> wrote: > if a function includes this SQL: > > Update Table1 Set field_1 = 'ab'; > Insert Table2(field_2) VALUES(

[GENERAL] timestamp problem

2008-04-02 Thread mailtolouis2020-postgres
when I switch to product database, it show error that this procedure not exit, it is looking for a procedure with TIMSTAMPTZ, why ? Is there somewhere in postgres can set not look for TIMESTAMPTZ, but TIMESTAMP? Regards Louis

[GENERAL] Duplicated primary key id happen

2008-05-09 Thread mailtolouis2020-postgres
Hello, I got a problem to restore a database, because there is a problem in my production database, which not suppose to happen like that, but it happen, not sure is a postgres bug or not. I got a table call CS_SR_MTHLY_RTN which has MTHLY_RTN_ID (INTEGER) as a primary key. So the MTHLY_RTN_ID

[GENERAL] Duplicated primary key id happen

2008-05-09 Thread mailtolouis2020-postgres
Hello, I got a problem to restore a database, because there is a problem in my production database, which not suppose to happen like that, but it happen, not sure is a postgres bug or not. I got a table call CS_SR_MTHLY_RTN which has MTHLY_RTN_ID (INTEGER) as a primary key. So the MTHLY_RTN_ID

[GENERAL] Scripting function definitions as SQL?

2008-05-11 Thread Postgres User
Has anyone written a function that scripts out all the functions in a database as full SQL statements (Create Function.) I found the below SQL will return all the fields needed to build a SQL statement, but it would take some work to combine the field values correctly to get the right format.

Re: [GENERAL] Scripting function definitions as SQL?

2008-05-11 Thread Postgres User
an Oosterhout <[EMAIL PROTECTED]> wrote: > On Sun, May 11, 2008 at 06:12:40AM -0700, Postgres User wrote: > > Has anyone written a function that scripts out all the functions in a > > database as full SQL statements (Create Function.) > > > > I found the below SQ

Re: [GENERAL] Scripting function definitions as SQL?

2008-05-11 Thread Postgres User
bert depesz lubaczewski <[EMAIL PROTECTED]> wrote: > On Sun, May 11, 2008 at 11:28:37AM -0700, Postgres User wrote: > > Unfortunately I didn't see a way to tell pg_dump to dump only objects > > of a specific type, like functions or sequences. It requires > > additi

[GENERAL] postgres crash when select a record

2008-05-14 Thread mailtolouis2020-postgres
Hello, I wish some could help me on this. I got a table which has 100500 records, when I try to query this particular record select * from cs_sr_mthly_rtn where mthly_rtn_id = 61609; Postgres crash, and show this errors: server closed the connection unexpectedly  This probably means the server

Re: [GENERAL] postgres crash when select a record

2008-05-14 Thread mailtolouis2020-postgres
No, I didn't run the query when the DB is in recovering. I did that after database system is ready - Original Message From: Glyn Astill <[EMAIL PROTECTED]> To: [EMAIL PROTECTED]; Postgres Sent: Wednesday, May 14, 2008 6:07:23 PM Subject: Re: [GENERAL] postgres crash wh

Re: [GENERAL] postgres crash when select a record

2008-05-14 Thread mailtolouis2020-postgres
Hello, Yes, I deleted that record, and now my backup is working fine! Thanks But why this problem came out? Is there anyway to trace it down and how it happen? Or is it a bug of postgres? Regards Louis - Original Message From: Pavel Stehule <[EMAIL PROTECTED]> To: [EMAIL PROTECT

Re: [GENERAL] postgres crash when select a record

2008-05-15 Thread mailtolouis2020-postgres
Hello Pavel, Thanks for the info, this is very great help. Regard Louis - Original Message From: Pavel Stehule <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Cc: Postgres Sent: Thursday, May 15, 2008 4:43:36 AM Subject: Re: [GENERAL] postgres crash when select a record Hello 200

[GENERAL] Converting each item in array to a query result row

2009-05-29 Thread Postgres User
Hi, I'd writing a query against a function (pg_proc) that contains 2 fields of an array type. Ideally, I'd like to select 1 row from the table, but return a query row for each item in the array. For example, if one row contains the array {"a", "b", "c"} I'd like the query to return 3 rows, one f

Re: [GENERAL] Converting each item in array to a query result row

2009-05-29 Thread Postgres User
Thanks for all the replies. I'm going to post the results of using the recommended approach in another thread. On Fri, May 29, 2009 at 1:18 PM, Adam Ruth wrote: > Good point, I should have specified 8.3.7. > > Just one more reason to anxiously anticipate upgrading to 8.4. > > > > On 30/05/2009,

[GENERAL] SQL to return all function parameters- its working

2009-05-29 Thread Postgres User
Based on replies to another post (recommending use of 'generate_series'), I was able to write the following query that returns all paramters of a given function. Only one interesting thing to note- in order to return the proper argument type, I had to use proargtypes[i - 1] when I expected th

[GENERAL] How to get the size of non fixed-length field from system catalog ?

2009-06-08 Thread Postgres User
Hi, I'm writing a small ORM tool and have written a number of queries to retrieve table metadata. One piece of data that I'm having trouble hunting down is the size of a CHAR field. For example, one table has a 'user_id' column of type CHAR(36). But when I look at the pg_attribute and pg_type t

[GENERAL] aliases for sequences and other DB objects?

2009-06-09 Thread Agoston Postgres
Hi! Is it possible in Postgres to specify aliases for various DB objects, such as tables, views, sequences, etc.? (For now I would like to create them for sequences.) What I mean is something like in Oracle, such as create alias my_sequence_alias for my_sequence; select nextval

[GENERAL] Maintaining user roles and permissions in Postgres - general question

2009-06-18 Thread Postgres User
Does anyone have a recommendation for maintaining user permissions on a changing database? The lack of an option to grant specific rights to all objects of a given type within a Postgres db obviously places the burden on the administrator to keep roles updated as objects are added and dropped

[GENERAL] Schema search_path and $user

2009-07-06 Thread Postgres User
In the docs, I see repeated references to $user in the postgresql.conf schema search_path setting such as: search_path = '"$user",public' But I don't see any info on the meaning of '$user' here. Is $user some kind of variable within postgresql.conf that refers to the current user? Can it be r

Re: [GENERAL] Schema search_path and $user

2009-07-06 Thread Postgres User
Thanks for the link, I wasn't reading the right page(s) in the documentation. On Mon, Jul 6, 2009 at 12:19 PM, Tom Lane wrote: > Postgres User writes: >> In the docs, I see repeated references to $user in the postgresql.conf >> schema search_path setting such as: > &

[GENERAL] Alternative to temp tables?

2009-09-11 Thread Postgres User
Hi, I have a simple function that returns a set of rows: CREATE OR REPLACE FUNCTION foo() RETURNS SETOF record AS $$ BEGIN RETURN QUERY SELECT * FROM people WHERE last_name = 'jones'; END $$ LANGUAGE 'plpgsql' In a separate function, I call the function and store the results in a temp tabl

[GENERAL] Using Insert - Default in a condition expression ??

2009-09-28 Thread Postgres User
Hi, I'm trying to write an INSERT INTO statement that will use a DEFAULT value when an input parameter is null. Here's the function that fails to compile. I tried replacing Coalesce with a Case statement but that fails as well. Note that if you replace the condition with a simple 'Default' it c

Re: [GENERAL] Using Insert - Default in a condition expression ??

2009-09-28 Thread Postgres User
>> I'm trying to write an INSERT INTO statement that will use a DEFAULT >> value when an input parameter is null. >> > Neither of my 2 methods are pretty. > 1) Use a trigger. > 2) Grab and cast the default value from the information_schema.columns > view and plug it in. > > Another option is to bui

Re: [GENERAL] Using Insert - Default in a condition expression ??

2009-09-29 Thread Postgres User
>> > >> > I'm trying to write an INSERT INTO statement that will use a DEFAULT >> > value when an input parameter is null. >> > >> Neither of my 2 methods are pretty. >> 1) Use a trigger. >> 2) Grab and cast the default value from the information_schema.columns >> view and plug it in. >> >> Another

[GENERAL] Composite types and tables - when to use?

2009-10-06 Thread Postgres User
Browsing the docs last night, I realized that I've never taken advantage of Postgres' powerful composite types. But a question came to mind- in what scenarios should you use a composite type in a table structure? That is, I can see the benefits of a composiite type insofar as it essent

[GENERAL] Composite types and tables - when to use?

2009-10-06 Thread Postgres User
Browsing the docs last night, I realized that I've never taken advantage of Postgres' powerful composite types.  But a question came to mind- in what scenarios should you use a composite type in a table structure?  That is, I can see the benefits of a composiite type insofar as it essent

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

2009-10-06 Thread Postgres User
EMS SQL Manager has a visual query builder, but it's a commerical product, ie it aint free. On Tue, Oct 6, 2009 at 12:47 PM, pere roca wrote: > > >  hi, >  some nice tool over there to let non-SQL knowing people to construct their > queries? I'm using pgAdmin III but I know some SQL. >  there is

[GENERAL] UDP Overflow / UDP Drops on Standby Postgres Service

2014-01-21 Thread Postgres Question
Postgres General List, I am stumped trying to prevent an overflowing UDP buffer on a standby Postgres service. Any help would be most appreciated. Essentially a UDP buffer associated with the pg_standby process on my localhost interface gradually fills up once I start Postgres until it

[GENERAL] Transport Compression (whatever became of that discussion?)

2011-04-19 Thread bubba postgres
In this discussion there was a lot of talk of transport compression in Postgres, (also specifically wondering about JDBC as well) did anything ever come of that discussion? http://postgresql.1045698.n5.nabble.com/Compression-on-SSL-links-td2261205.html

[GENERAL] pg_dump on Hot standby : clarification on how to

2011-05-12 Thread bubba postgres
I would just like to get some clarification from the list on how to do a pg_dump on the slave in the face of "canceling statement due to conflict with recovery". The following links seem to indicate that If I start an idle transaction on the master I should be able to do the pg_dump, but I tried th

Re: [GENERAL] pg_dump on Hot standby : clarification on how to

2011-05-13 Thread bubba postgres
was more to it than that. On Thu, May 12, 2011 at 5:08 PM, Andrew Sullivan wrote: > On Thu, May 12, 2011 at 11:26:38AM -0700, bubba postgres wrote: > > I would just like to get some clarification from the list on how to do a > > pg_dump on the slave in the face of "canc

[GENERAL] General Postgres performance tips when using ARRAY

2011-05-25 Thread bubba postgres
So, what are the gotcha's around manipulating Arrays in stored procs? It seems reasonable that an array_cat /etc would cause the creation of a new array, but does mutating an existing array also create a copy?

[GENERAL] Why are IDLE connections using cpu according to TOP.

2011-06-03 Thread bubba postgres
50 processes: 3 running, 42 sleeping, 5 uninterruptable CPU states: 21.7% user, 0.0% nice, 7.8% system, 46.9% idle, 23.6% iowait Memory: 29G used, 149M free, 13M buffers, 27G cached Swap: PID USERNAME PRI NICE SIZE RES STATE TIME WCPUCPU COMMAND 4779 postgres 200 4383M 573M

[GENERAL] Are check constraints always evaluated on UPDATE?

2011-06-17 Thread bubba postgres
Are there any optimizations around check constraints such that they will not be evaluated if constituent columns are not updated? Regards, -JD

[GENERAL] Odd performance difference in check constraint : SQL(slow) vs plpgsql(fast)

2011-06-17 Thread bubba postgres
This is the reverse of what I thought I would find. In short my check constraint is extracting the epoch from a start timestamp, and an end timestamp to get the number of seconds difference. It then uses this number to check the array_upper() of an array to make sure it's the proper size The SQL

  1   2   >