Re: [GENERAL] stored function - array parameter - how many element in array ?

2006-07-13 Thread Volkan YAZICI
On Jul 13 08:28, Claire McLister wrote: > Have you considered using a set instead? We had a similar need and > were using an array as a parameter. That turned out to be taking too > long. Recently we have changed it to a set and it seems to work > faster, although I must admit I haven't timed

Re: [GENERAL] Timestamp vs timestamptz

2006-07-13 Thread Michael Glaesemann
On Jul 13, 2006, at 21:49 , Agent M wrote: For example, flight arrival information should probably include the timezone of the destination. Of course, for this example you'd also want to know *where* the flight is arriving, which would also let you know the appropriate time zone in an in

Re: [GENERAL] Timestamp vs timestamptz

2006-07-13 Thread Agent M
But watch out! This is mentioned in the docs but it bit me when I used timestamp with time zone so: timestamp with time zone does not record the timezone you inserted it with- it simply stores the GMT version and converts to whatever timezone you like on demand. If the timezone is important da

Re: [GENERAL] Need help with quote escaping in exim for postgresql

2006-07-13 Thread Tom Lane
[ Coming late to the thread... ] Steve Atkins <[EMAIL PROTECTED]> writes: > Fortunately all this stuff is MUA-side, not MTA-side, so exim > should ignore it. SQL_ASCII all the way. I concur. The recent encoding fixes are for the situation where the database server believes a multibyte encoding i

Re: [GENERAL] duplicated values on primary key field on reindex

2006-07-13 Thread Tom Lane
"Weerts, Jan" <[EMAIL PROTECTED]> writes: > Scott Marlowe wrote: >> Can you get set of fields in that row to uniquely identify it by? >> >> If so, see if you can update that column to something else and >> continue > The only way would be to update by primarykey. But since the > select on the pr

Re: [GENERAL] Timestamp vs timestamptz

2006-07-13 Thread David Fetter
On Thu, Jul 13, 2006 at 04:35:20PM -0700, Antimon wrote: > Hi, > I'm working on a web project with pgsql, i did use mysql before and > stored epoch in database so i'm not familiar with these datatypes. > > What i wanna ask is, if i don't need to display timestamps in > different timezones, Not th

[GENERAL] Function Help

2006-07-13 Thread Jamie Deppeler
Hi, I am having a problem with a delete function. The delete function uses 3 tables (tablea,tableb,tablec) tablec stores actual values and tablea+b stores summaries when a entry in tablec is deleted i updated the values in tablea+b, The problem when i do a cascade delete on tablea tablec dele

[GENERAL] Timestamp vs timestamptz

2006-07-13 Thread Antimon
Hi, I'm working on a web project with pgsql, i did use mysql before and stored epoch in database so i'm not familiar with these datatypes. What i wanna ask is, if i don't need to display timestamps in different timezones, shall i use timestamptz anyway? I mean, i'm gonna need timestamp columns on

Re: [GENERAL] Is there a way to run tables in RAM?

2006-07-13 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Roy Souther wrote: > I would like to know if there is anyway to move a section of some tables > into RAM to work on them. > > I have large table, about 700MB or so and growing. I also have a bizarre > collection of queries that run hundreds of queries

Re: [GENERAL] Is there a way to run tables in RAM?

2006-07-13 Thread Karen Hill
Roy Souther wrote: > I would like to know if there is anyway to move a section of some tables > into RAM to work on them. > > I have large table, about 700MB or so and growing. I also have a bizarre > collection of queries that run hundreds of queries on a small section of > this table. These quer

Re: [GENERAL] How come index isn't being used when query by function return

2006-07-13 Thread Joseph Shraibman
It is STABLE, which I finally figured out. I had to find section 31.6 of the docs, which is nowhere near the part about writing functions. Merlin Moncure wrote: On 7/13/06, Joseph Shraibman wrote: db:db=>explain select * from elog where id = eds('2006-01-01');

Re: [GENERAL] Is there a way to run tables in RAM?

2006-07-13 Thread Tim Hart
I can’t say for certain from the detail you’ve given, but partial indexes may be an acceptable solution to your problem.   http://www.postgresql.org/docs/8.1/interactive/indexes-partial.html     From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Roy Souther Sent: Th

Re: [GENERAL] How come index isn't being used when query by function return value?

2006-07-13 Thread Merlin Moncure
On 7/13/06, Joseph Shraibman wrote: db:db=>explain select * from elog where id = eds('2006-01-01'); QUERY PLAN --- Seq Scan on elog (cost=0.00..1894975.10 rows=1 wi

[GENERAL] How come index isn't being used when query by function return value?

2006-07-13 Thread Joseph Shraibman
db:db=>explain select * from elog where id = eds('2006-01-01'); QUERY PLAN --- Seq Scan on elog (cost=0.00..1894975.10 rows=1 width=204) Filter: (id = eds('2006-01-0

=?UTF-8?Q? Re: =3D???UTF-8?Q?re: [GENERAL] How to insert .xls...?=

2006-07-13 Thread lanczos
> [mailto:[EMAIL PROTECTED] On Behalf Of Adrian Klaver > > Dates don't transfer correctly. When I try it the date moves > two days ahead. I just checked it, on my computer it works fine, no date shift. Regards Tomas > ---(end of broadcast)---

Re: [GENERAL] Is there a way to run tables in RAM?

2006-07-13 Thread Merlin Moncure
On 7/13/06, Roy Souther <[EMAIL PROTECTED]> wrote: I would like to know if there is anyway to move a section of some tables into RAM to work on them. the operating system should cache the table if there is memory available. while disk cache is somewhat slower than raw memory read, now you h

Re: [GENERAL] I need help creating a query

2006-07-13 Thread Richard Broersma Jr
> > worker: worker_id, name > position: position_id, worker_id, position, startdate, salary > > If I perfom a query joining both tables, I can obtain all the workers and > the positions the've had. > > SELECT name, startdate, position, salary FROM worker JOIN position > USING(worker_id); > wo

[GENERAL] Clustering and backup with large objects

2006-07-13 Thread Marco Bizzarri
Hi all. I'm working on a document management application (PAFlow). The application is Zope based and uses PostgreSQL as its (main) storage system. PostgreSQL must contain both profile data for documents and the documents themselves. Documents are stored as large objects in PostgreSQL. Up to now

Re: [GENERAL] I need help creating a query

2006-07-13 Thread Dann Corbit
The query date supplied should be applied against start date and then take the minimum record from that set.   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Sergio Duran Sent: Thursday, July 13, 2006 12:20 PM To: pgsql-general@postgresql.org Subject: [GENERAL]

[GENERAL] I need help creating a query

2006-07-13 Thread Sergio Duran
Hello,I need a little help creating a query, I have two tables, worker and position, for simplicity sake worker only has its ID and its name, position has the ID of the worker, the name of his position, a date, and his salary/ worker:   worker_id, nameposition: position_id, worker_id, position, sta

Re: [GENERAL] Is there a way to run tables in RAM?

2006-07-13 Thread Joshua D. Drake
Is there anyway to create a temporary table that will only exist in RAM and not be written to the hard drive? Or do temporary tables already do that? That is what temp tables do... but you should only use them for throwaway data :) Joshua D. Drake If I can use a temporary table this wa

[GENERAL] SPI based table locks.

2006-07-13 Thread Chris Bowlby
Hi All, I've been working on a small module that I will be pluging into my local PostreSQL 8.x database and am in need of doing some table locking. At this time, I've used various other examples to no avail and was wondering what the proper method for aquiring a table lock within the module w

Re: [GENERAL] Is there a way to run tables in RAM?

2006-07-13 Thread Martijn van Oosterhout
On Thu, Jul 13, 2006 at 11:44:43AM -0600, Roy Souther wrote: > I would like to know if there is anyway to move a section of some tables > into RAM to work on them. > > I have large table, about 700MB or so and growing. I also have a bizarre > collection of queries that run hundreds of queries on a

Re: [GENERAL] Trying to connect to an Oracle instance...

2006-07-13 Thread Joe Conway
A.M. wrote: On Thu, July 13, 2006 11:03 am, Tony Caduto wrote: Spendius wrote: I've been trying to perform a connection to an Oracle DB for a while, to no avail. Here is what I get at my psql prompt: postdb=# Select dblink_connect('login','hostaddr= port=1521 \ If you are trying to connect t

[GENERAL] Is there a way to run tables in RAM?

2006-07-13 Thread Roy Souther
I would like to know if there is anyway to move a section of some tables into RAM to work on them. I have large table, about 700MB or so and growing. I also have a bizarre collection of queries that run hundreds of queries on a small section of this table. These queries only look at about 100

Re: [GENERAL] Database connectivity using ECPG

2006-07-13 Thread Shoaib Mir
Hi Jasbinder,You will have to build the libecpg lib from source first and then you can build your C source (got from .pgc file using ecpg) using something like this: cc -I -c sample.c cc -o sample sample.o -L -lecpgThanks,Shoaib MirEnterpriseDBOn 7/13/06, John Purser < [EMAIL PROTECTED]> wrote:On

Re: [GENERAL] Database connectivity using ECPG

2006-07-13 Thread John Purser
On Thu, 13 Jul 2006 13:22:49 -0400 "Jasbinder Bali" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using ECPG to connect to my postgres database. Doing it for the > very first time in my life. > > The name of my database is postgres and uses a trusted connection. > So, i don't think it needs any authe

Re: [GENERAL] Database connectivity using ECPG

2006-07-13 Thread Merlin Moncure
On 7/13/06, Jasbinder Bali <[EMAIL PROTECTED]> wrote: Hi, I'm using ECPG to connect to my postgres database. Doing it for the very first time in my life. In function `main':ecpg_test.c:(.text+0x5d): undefined reference to `ECPGconnect' it looks like you are not linking to the ecpg library.

[GENERAL] Database connectivity using ECPG

2006-07-13 Thread Jasbinder Bali
Hi,I'm using ECPG to connect to my postgres database. Doing it for the very first time in my life.The name of my database is postgres and uses a trusted connection. So, i don't think it needs any authentication parameteres like a user name and password.I have the follwoing line of code in my .pgc

Re: =???UTF-8?Q?re: [GENERAL] How to insert .xls files into

2006-07-13 Thread Guy Fraser
On Thu, 2006-13-07 at 06:52 -0700, Adrian Klaver wrote: > Dates don't transfer correctly. When I try it the date moves two days ahead. Thanks for the heads up, I will continue to avoid using Open Office for Spreadsheet and DB activities. I prefer Gnumeric for Spreadsheet activities, and am very

Re: [GENERAL] Trying to connect to an Oracle instance...

2006-07-13 Thread A.M.
On Thu, July 13, 2006 11:03 am, Tony Caduto wrote: > Spendius wrote: > >> Hi, >> I've been trying to perform a connection to an Oracle DB for a while, >> to no avail. Here is what I get at my psql prompt: postdb=# Select >> dblink_connect('login','hostaddr= port=1521 \ >> > If you are trying to con

Re: [GENERAL] stored function - array parameter - how many element in array ?

2006-07-13 Thread Claire McLister
Have you considered using a set instead? We had a similar need and were using an array as a parameter. That turned out to be taking too long. Recently we have changed it to a set and it seems to work faster, although I must admit I haven't timed it yet. In the first case you call it by "sel

Re: [GENERAL] cant connect to the database, even after doing start

2006-07-13 Thread Scott Marlowe
On Thu, 2006-07-13 at 01:20, surabhi.ahuja wrote: > Hi all, > i have a script to stop and start postmaster > > However i have noticed this many a time sdnow. I stop postmaster using > that script > and then start using a script. > > However if i try to do psql , it gives me an error saying that

Re: [GENERAL] SQL Standards Compliance With Case

2006-07-13 Thread Scott Marlowe
On Wed, 2006-07-12 at 22:26, Tom Lane wrote: > Rich Shepard <[EMAIL PROTECTED]> writes: > >I'm trying to assist the XRMS developers port their application to > > postgres (8.1.x on), and it's almost there. One (perhaps the only) stumbling > > block is case for table and column (relation and att

Re: [GENERAL] db clustering?

2006-07-13 Thread Scott Marlowe
On Wed, 2006-07-12 at 15:22, Peter Murray & Uta Wussing wrote: > I have some postgres cluster questions: > > I would like to have the ability to dynamically re-size a cluster of > Postgres DB instances. > > > 0. Can I create a Postgres cluster? > - more than one instance of Postgres running on m

Re: [GENERAL] Delete Problem

2006-07-13 Thread Scott Marlowe
On Thu, 2006-07-13 at 01:41, surabhi.ahuja wrote: > even i have seen this problem > > i am using postgres 8.0.0 > > i open psql > > and there i try to do > delete from > > it seems that psql gets stuck. > > even after 5 mins or something, no deletion happens. > > generally this happen

Re: [GENERAL] Trying to connect to an Oracle instance...

2006-07-13 Thread Michael Fuhr
On Thu, Jul 13, 2006 at 05:46:55AM -0700, Spendius wrote: > I've been trying to perform a connection to an Oracle DB for a while, > to no avail. Here is what I get at my psql prompt: > postdb=# Select dblink_connect('login','hostaddr= port=1521 \ > dbname=orasid user=mylogin password=mypwd'); > ERR

Re: [GENERAL] Trying to connect to an Oracle instance...

2006-07-13 Thread Tony Caduto
Spendius wrote: Hi, I've been trying to perform a connection to an Oracle DB for a while, to no avail. Here is what I get at my psql prompt: postdb=# Select dblink_connect('login','hostaddr= port=1521 \ If you are trying to connect to a Oracle DB, don't you need to be using DBI Link instead o

Re: [GENERAL] getting function argument names from psql?

2006-07-13 Thread Peter Eisentraut
Am Donnerstag, 13. Juli 2006 15:16 schrieb David Fetter: > Back when, I submitted a psql patch to get the input names along with > their types. Shall I dig up that code this weekend? Seems reasonable, as long as it doesn't make the output an extra three screens wide. -- Peter Eisentraut http:/

Re: [GENERAL] VPD

2006-07-13 Thread Richard Broersma Jr
> Oracle has a feature called "Virtual Private Databases" (VPD), that > enables you to configure permissions at row level. Is there an > equivalent feature in PostgreSQL? Not inherent to Postgresql itself, but there is a complementary package that will do this. http://veil.projects.postgresql.o

Re: [GENERAL] getting function argument names from psql?

2006-07-13 Thread David Fetter
On Thu, Jul 13, 2006 at 03:39:34PM +0200, Peter Eisentraut wrote: > Am Donnerstag, 13. Juli 2006 15:16 schrieb David Fetter: > > Back when, I submitted a psql patch to get the input names along > > with their types. Shall I dig up that code this weekend? > > Seems reasonable, as long as it doesn'

[GENERAL] Trying to connect to an Oracle instance...

2006-07-13 Thread Spendius
Hi, I've been trying to perform a connection to an Oracle DB for a while, to no avail. Here is what I get at my psql prompt: postdb=# Select dblink_connect('login','hostaddr= port=1521 \ dbname=orasid user=mylogin password=mypwd'); ERROR: could not establish connection DETAIL: server closed the c

Re: =???UTF-8?Q?re: [GENERAL] How to insert .xls files into

2006-07-13 Thread Adrian Klaver
Dates don't transfer correctly. When I try it the date moves two days ahead. On Wednesday 12 July 2006 08:43 am, Guy Fraser wrote: > On Fri, 2006-07-07 at 22:41 +, [EMAIL PROTECTED] wrote: > > > [mailto:[EMAIL PROTECTED] On Behalf Of Adrian Klaver > > > > > > I guess the solution depends on wh

[GENERAL] VPD

2006-07-13 Thread jose
/Hello, Oracle has a feature called "Virtual Private Databases" (VPD), that enables you to configure permissions at row level. Is there an equivalent feature in PostgreSQL? Thank you, jss / ---(end of broadcast)--- TIP 9: In versions below 8

[GENERAL] Physical block structure in PostgreSQL

2006-07-13 Thread Spendius
Hi, I found no description of the way the records of a table are physically stored in files with PostgreSQL. I said "block structure" in my subject but actually is there any such thing as a block ? (I read the pages http://www.postgresql.org/docs/8.1/interactive/storage.html and saw things regard

Re: [GENERAL] getting function argument names from psql?

2006-07-13 Thread David Fetter
On Thu, Jul 13, 2006 at 09:22:56AM -0400, Merlin Moncure wrote: > On 7/13/06, David Fetter <[EMAIL PROTECTED]> wrote: > >On Wed, Jul 12, 2006 at 11:37:04PM -0400, Tom Lane wrote: > >Back when, I submitted a psql patch to get the input names along > >with their types. Shall I dig up that code this

Re: [GENERAL] getting function argument names from psql?

2006-07-13 Thread Merlin Moncure
On 7/13/06, David Fetter <[EMAIL PROTECTED]> wrote: On Wed, Jul 12, 2006 at 11:37:04PM -0400, Tom Lane wrote: > > select oid::regprocedure from pg_proc where proname like 'your > > name here'; > > Nope, because regprocedureout doesn't include argument names (nor > modes). I think the best way AT

Re: [GENERAL] Performance problem with query

2006-07-13 Thread Merlin Moncure
On 7/13/06, Christian Rengstl <[EMAIL PROTECTED]> wrote: Good morning list, the following query takes about 15 to 20 minutes for around 2 million lines in the file myfile.txt, but with 8 million lines it takes around 5 hours and i just don't understand why there is such a huge discrepancy in p

Re: [GENERAL] getting function argument names from psql?

2006-07-13 Thread David Fetter
On Wed, Jul 12, 2006 at 11:37:04PM -0400, Tom Lane wrote: > "Merlin Moncure" <[EMAIL PROTECTED]> writes: > > On 7/12/06, Timothy Perrigo <[EMAIL PROTECTED]> wrote: > >> Is there a way to get the names of the arguments to a function > >> from psql? /df and /df+ return the parameter types, but not >

Re: [GENERAL] stored function - array parameter - how many element in array ?

2006-07-13 Thread Merlin Moncure
On 7/13/06, Özgür Tuğrul <[EMAIL PROTECTED]> wrote: hello, the question is very clear .. when we write stored function, we can use array parameter as a variable .. but, in the function, how do i know how many element in that array ? i want to perform some dml operations about each one like (d

[GENERAL] stored function - array parameter - how many element in array ?

2006-07-13 Thread Özgür Tuğrul
hello,   the question is very clear .. when we write stored function, we can use array parameter as a variable  .. but, in the function, how do i know how many element in that array ?   i want to perform some dml operations about each one like (delete, update or delete)   can anyone show me the exa

Re: [GENERAL] db clustering?

2006-07-13 Thread Bill Moran
Peter Murray & Uta Wussing <[EMAIL PROTECTED]> wrote: > I have some postgres cluster questions: > > I would like to have the ability to dynamically re-size a cluster of > Postgres DB instances. > > > 0. Can I create a Postgres cluster? > - more than one instance of Postgres running on m

Re: [GENERAL] doesn't recognize "!=-" (not equal to a negative value)

2006-07-13 Thread hubert depesz lubaczewski
On 7/11/06, Paul Tilles <[EMAIL PROTECTED]> wrote: Yes.  That works.  I think that the parser should work properly either way.it works properly. just the proper way of functioning is not the one you would like to have.you can simply add this operator: CREATE FUNCTION not_equals_minus(int8, int8) RE

Re: [GENERAL] Delete Problem

2006-07-13 Thread Michael Fuhr
On Thu, Jul 13, 2006 at 05:26:31PM +1000, Jamie Deppeler wrote: > PostgreSQL 8.1.3 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.0.3 > 20060104 (prerelease) (Debian 4.0.2-6) What about the other outputs I mentioned? -- Michael Fuhr ---(end of broadcast)-

Re: [GENERAL] Delete Problem

2006-07-13 Thread Jamie Deppeler
PostgreSQL 8.1.3 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.0.3 20060104 (prerelease) (Debian 4.0.2-6) Michael Fuhr wrote: On Thu, Jul 13, 2006 at 04:58:26PM +1000, Jamie Deppeler wrote: db=# \d job Table "job" Column|

Re: [GENERAL] Delete Problem

2006-07-13 Thread Michael Fuhr
On Thu, Jul 13, 2006 at 04:58:26PM +1000, Jamie Deppeler wrote: > db=# \d job >Table "job" > Column|Type > | Modifiers > -+-+-

Re: [GENERAL] Delete Problem

2006-07-13 Thread surabhi.ahuja
Title: Re: [GENERAL] Delete Problem even i have seen this problem   i am using postgres 8.0.0   i open psql   and there i try to do delete from   it seems that psql gets stuck.   even after 5 mins or something, no deletion happens.   generally this happens when the disk is nearing to ful

[GENERAL] Performance problem with query

2006-07-13 Thread Christian Rengstl
Good morning list, the following query takes about 15 to 20 minutes for around 2 million lines in the file myfile.txt, but with 8 million lines it takes around 5 hours and i just don't understand why there is such a huge discrepancy in performance. COPY public.temp_table FROM 'myfile.txt' WITH

Re: [GENERAL] Delete Problem

2006-07-13 Thread Jamie Deppeler
Not sure if it disk space as i have around 10gig free surabhi.ahuja wrote: even i have seen this problem i am using postgres 8.0.0 i open psql and there i try to do delete from it seems that psql gets stuck. even after 5 mins or something, no deletion happens. generally this happe

Re: [GENERAL] Delete Problem

2006-07-13 Thread Michael Fuhr
On Thu, Jul 13, 2006 at 04:28:50PM +1000, Jamie Deppeler wrote: > From psql > > db=# select "primary" from job where "primary" = 370; > primary > - > 370 > (1 row) > > db=# delete from job where "primary" = 370; > DELETE 0 You said that you had deleted all triggers -- have you verifi

Re: [GENERAL] Delete Problem

2006-07-13 Thread Jamie Deppeler
db=# \d job Table "job" Column|Type | Modifiers -+-+ primary

Re: [GENERAL] Dynamic table with variable number of columns

2006-07-13 Thread nkunkov
Hi, Thanks again. One more question. Will crosstab function work if i will not know the number/names of columns before hand? Or I need to supply colum headings? Thanks again. NK Bruno Wolff III wrote: > On Wed, Jul 12, 2006 at 07:08:15 -0700, > [EMAIL PROTECTED] wrote: > > > > Thank you for t

Re: [GENERAL] Dynamic table with variable number of columns

2006-07-13 Thread nkunkov
Hi Thomas, No I actually need the product name (prod1, prod2) to become column headings, which is effectively transposing the table. Thanks. NK - Original Message - From: Thomas Burdairon <[EMAIL PROTECTED]> Date: Wednesday, July 12, 2006 10:53 am Subject: Re: [GENERAL] Dynamic table