[GENERAL] Complete row is fetched ?

2010-04-15 Thread Satish Burnwal (sburnwal)
I have a ques - say I have a table that has 10 columns. But in a simple select query from that table, I use just 3 columns. I want to know whether even for fetching 3 columns, read happens for all the 10 columns and out of that the required 3 columns are returned ? ie Does the complete row with all

Re: [GENERAL] Complete row is fetched ?

2010-04-15 Thread John R Pierce
Satish Burnwal (sburnwal) wrote: I have a ques - say I have a table that has 10 columns. But in a simple select query from that table, I use just 3 columns. I want to know whether even for fetching 3 columns, read happens for all the 10 columns and out of that the required 3 columns are returned

Re: [GENERAL] Complete row is fetched ?

2010-04-15 Thread A. Kretschmer
In response to Satish Burnwal (sburnwal) : > I have a ques - say I have a table that has 10 columns. But in a simple > select query from that table, I use just 3 columns. I want to know > whether even for fetching 3 columns, read happens for all the 10 columns > and out of that the required 3 colum

[GENERAL] modification time & transaction synchronisation problem

2010-04-15 Thread Ostrovsky Eugene
Hi. I need to export data from the database to external file. The difficulty is that only data modified or added since previous export should be written to the file. I consider adding "modification_time" timestamp field to all the tables that should be exported. Then I can set this field to now()

Re: [GENERAL] optimalisation with EXCEPT clause

2010-04-15 Thread Kincel, Martin
Thank you for the answer Grzegorz. > if you have a primary key on the table, and you should, you might get better > performance using LEFT JOIN. Well as far as I know, the result of such JOIN is a cartezian product, which is not exactly what I need. I need the same structure as table 'data' has

Re: [GENERAL] readline library not found

2010-04-15 Thread Greg Smith
zhong ming wu wrote: After explicitly specfying these paths with --with-libs and with-includes postgres configure is still choking on readline. Doing this is painful, but one hack you can try is pointing: export LD_LIBRARY_PATH=/home/me/local/lib I've used that combined with setting --with

Re: [GENERAL] [SOLVED] Error in Trigger function. How to correct?

2010-04-15 Thread Dave Page
On Thu, Apr 15, 2010 at 4:10 AM, Bruce Momjian wrote: >> > PPAS 8.1 = PostgreSQL 8.1 >> > PPAS 8.3x = PostgreSQL 8.2 base (plus HOT and wal_writer) >> > PPAS 8.4 = PostgreSQL 8.4 (plus compatibility) >> > PPAS 9 [is planned to] = PostgreSQL 9.0 >> >> So there was no actual 8.3 base release of PPAS

[GENERAL] How to get whether user has ALL permissions on table?

2010-04-15 Thread dipti shah
Hi, I have granted ALL permissions on 'techtable' to 'user1'. techdb=# select pc.relname, pc.relacl from pg_class pc, pg_namespace pn where pc.relnamespace=pn.oid and pn.nspname='techdb' and pc.relname='techtable'; relname | relacl ---+-

Re: [GENERAL] How to get whether user has ALL permissions on table?

2010-04-15 Thread A. Kretschmer
In response to dipti shah : > > Hi, I have granted ALL permissions on 'techtable' to 'user1'. >   >  techdb=# select pc.relname, pc.relacl from pg_class pc, pg_namespace pn where > pc.relnamespace=pn.oid and pn.nspname='techdb' and pc.relname='techtable'; >  relname   |

Re: [GENERAL] How to get whether user has ALL permissions on table?

2010-04-15 Thread dipti shah
Thanks Kretschmer but I have seen those function. The below query returns error but you could see that 'user1' has ALL permissions on table 'techtable'. techdb=# SELECT has_table_privilege('user1', 'techtable', 'ALL'); ERROR: unrecognized privilege type: "ALL" techdb=# select pc.relname, pc.rela

Re: [GENERAL] Inconsistent SQL errors

2010-04-15 Thread Boszormenyi Zoltan
gvim írta: > I'm running PostgreSQL 8.4.3 on OS X Snow Leopard via MacPorts and I'm > getting strange inconsistent errors such as: > > dbuser-# select * from log_form; The error is here above. You had a "-#" prompt, saying that you already started another statement in a previous line but you haven

Re: [GENERAL] How to get whether user has ALL permissions on table?

2010-04-15 Thread A. Kretschmer
In response to dipti shah : > Thanks Kretschmer but I have seen those function. The below query returns > error > but you could see that 'user1' has ALL permissions on table 'techtable'. >   > techdb=# SELECT has_table_privilege('user1', 'techtable', 'ALL'); > ERROR:  unrecognized privilege type:

Re: [GENERAL] How to get whether user has ALL permissions on table?

2010-04-15 Thread dipti shah
Okay. Thanks. Dipti. On Thu, Apr 15, 2010 at 3:20 PM, A. Kretschmer < andreas.kretsch...@schollglas.com> wrote: > In response to dipti shah : > > Thanks Kretschmer but I have seen those function. The below query returns > error > > but you could see that 'user1' has ALL permissions on table 'tec

Re: [GENERAL] Query is stuck

2010-04-15 Thread Satish Burnwal (sburnwal)
Great!! Your help is very valuable!! -Original Message- From: Justin Graf [mailto:jus...@magwerks.com] Sent: Wednesday, April 14, 2010 7:35 PM To: Bill Moran Cc: Satish Burnwal (sburnwal); pgsql-general@postgresql.org Subject: Re: [GENERAL] Query is stuck I suggest writting something lik

Re: [GENERAL] How to insert Ecoded values into postrgresql

2010-04-15 Thread Merlin Moncure
On Thu, Apr 15, 2010 at 12:29 AM, Tom Lane wrote: > Bruce Momjian writes: >> Merlin Moncure wrote: >>> aside: anyone know if postgres properly handles csv according to rfc4180? > >> Wow, I had no idea there was an RFC for CSV. > > Me either.  I'd bet the percentage of "CSV"-using programs that ac

Re: [GENERAL] VACUUM process running for a long time

2010-04-15 Thread Jan Krcmar
hi 2010/4/14 Adrian von Bidder : >  -> vacuum can run concurrently to other stuff, so it's not necessary to > wait before it finishes. >  -> in most cases, autovacuum should do the Right Thing(tm) atomatically, so > you should not need to call vacuum manually. > > This is with a recent pg version.

Re: [GENERAL] When is an explicit cast necessary?

2010-04-15 Thread Alvaro Herrera
Alan Millington wrote: > If you think that smallints are more bother than they are worth, perhaps you > should remove support for smallints completely. Then people would know where > they stood. (Or you could make smallint a synonym for int.) smallint can be used usefully -- you just need to kn

Re: [GENERAL] pl/java status

2010-04-15 Thread Joshua D. Drake
On Wed, 2010-04-14 at 22:53 -0400, Bruce Momjian wrote: > Damian Carey wrote: > > On Thu, Apr 15, 2010 at 6:18 AM, John R Pierce wrote: > > > Joshua D. Drake wrote: > > >> > > >> Mostly, I think you will find that the back end developers aren't fond > > >> of Java and thus, it doesn't get much lov

[GENERAL] solaris tarballs and pl/java

2010-04-15 Thread John R Pierce
The tarball for 64bit 8.4.3 on Solaris Sparc is missing some ./pgxs/... files I seem to need to build pl/java. they exist in the 32bit version but at least of them, Makefile.global, appears quite build specific. $ ls -l 8.4-community/lib/pgxs/src/ total 91 -r--r--r-- 1 postgres postgres 1

Re: [GENERAL] solaris tarballs and pl/java

2010-04-15 Thread Greg Smith
John R Pierce wrote: The tarball for 64bit 8.4.3 on Solaris Sparc is missing some ./pgxs/... files I seem to need to build pl/java. they exist in the 32bit version but at least of them, Makefile.global, appears quite build specific. Yeah, it seemed pretty obvious from the error you were runn

[GENERAL] Byte Escape Syntax

2010-04-15 Thread Howard Yeh
Hi, Is Postgres's byte escape syntax something that could be set by the client? I am running into a strange problem when I access postgres try two different Ruby ORM's. I am guessing that one of them is doing something funny to the client connections. Looking at the Ruby C-driver, it's calling P

Re: [GENERAL] Byte Escape Syntax

2010-04-15 Thread Tom Lane
Howard Yeh writes: > Is Postgres's byte escape syntax something that could be set by the client? Well, indirectly --- it's affected by the standard_conforming_strings setting. > I am running into a strange problem when I access postgres try two > different Ruby ORM's. I am guessing that one of t

Re: [GENERAL] solaris tarballs and pl/java

2010-04-15 Thread John R Pierce
Greg Smith wrote: John R Pierce wrote: The tarball for 64bit 8.4.3 on Solaris Sparc is missing some ./pgxs/... files I seem to need to build pl/java. they exist in the 32bit version but at least of them, Makefile.global, appears quite build specific. Yeah, it seemed pretty obvious from the

Re: [GENERAL] Showing debug messages in my C function

2010-04-15 Thread Jorge Arevalo
On Tue, Apr 13, 2010 at 10:04 PM, Tom Lane wrote: > Jorge Arevalo writes: >> I'm sorry, because this may be a simple question: I'm programming a C >> function that returns a set (PostgreSQL 8.4). The function crash, and >> I'm trying to >> debug it. I've read: > >> http://www.postgresql.org/docs/

Re: [GENERAL] solaris tarballs and pl/java

2010-04-15 Thread John R Pierce
John R Pierce wrote: Last night, I started trying to piece together the environment for ./configure for postgres based on what pg_config gives me, but it aborted pretty early with missing stuffs... by then it was 1am and I was fried so I am taking a fresh look this morning... k, I'm already

Re: [GENERAL] solaris tarballs and pl/java

2010-04-15 Thread Tom Lane
John R Pierce writes: > getting this error from thte ./configure: > configure:16808: error: cannot compute sizeof (off_t) That's pretty weird. Look into the config.log output to see why that particular test program is failing. (The relevant bit will probably be a few hundred lines before th

Re: [GENERAL] solaris tarballs and pl/java

2010-04-15 Thread Ozz Nixon
Would this syntax work in PostgreSQL? |INSERT INTO MyTable (FirstCol, SecondCol) VALUES ('First',1), || ('||Second||',2),| | ('||Third||',3),| | ('||Fourth||',4),| | ('||Fifth||',5)|| | Inserting 5 rows in a single Insert? (I am trying to implement this solution across many different backends) w

[GENERAL] General Question about database -- redirection

2010-04-15 Thread akp geek
dear all - I am not supposed to ask this. But, the question is I have 2 databases DB_1 and DB_2. I have a script that loads few tables in DB_1. The 2 databases are identical. In case , if database DB_1 is dropped, Is there any command that I can issue to use the DB_2? Regards

Inserting multiple values, was Re: [GENERAL] solaris tarballs and pl/java

2010-04-15 Thread Raymond O'Donnell
On 15/04/2010 20:44, Ozz Nixon wrote: > Would this syntax work in PostgreSQL? > > |INSERT INTO MyTable (FirstCol, SecondCol) > VALUES ('First',1), > || ('||Second||',2),| > | ('||Third||',3),| > | ('||Fourth||',4),| > | ('||Fifth||',5)|| > | > Inserting 5 rows in a single Insert? (I am trying to i

Re: [GENERAL] solaris tarballs and pl/java

2010-04-15 Thread Alvaro Herrera
Ozz Nixon escribió: > Would this syntax work in PostgreSQL? > > |INSERT INTO MyTable (FirstCol, SecondCol) > VALUES ('First',1), > || ('||Second||',2),| > | ('||Third||',3),| > | ('||Fourth||',4),| > | ('||Fifth||',5)|| Yes, it works (without all those funny || though) -- Alvaro Herrera

Re: [GENERAL] solaris tarballs and pl/java

2010-04-15 Thread John R Pierce
Tom Lane wrote: John R Pierce writes: getting this error from thte ./configure: configure:16808: error: cannot compute sizeof (off_t) That's pretty weird. Look into the config.log output to see why that particular test program is failing. (The relevant bit will probably be a few

Re: [GENERAL] solaris tarballs and pl/java

2010-04-15 Thread Alvaro Herrera
John R Pierce wrote: > Tom Lane wrote: > >John R Pierce writes: > >>getting this error from thte ./configure: > >>configure:16808: error: cannot compute sizeof (off_t) > > > >That's pretty weird. Look into the config.log output to see why that > >particular test program is failing. (The rele

Re: [GENERAL] solaris tarballs and pl/java

2010-04-15 Thread Andy Colson
On 4/15/2010 11:59 AM, John R Pierce wrote: The tarball for 64bit 8.4.3 on Solaris Sparc is missing some ./pgxs/... files I seem to need to build pl/java. they exist in the 32bit version but at least of them, Makefile.global, appears quite build specific. So, it seem to be painful to compile t

Re: [GENERAL] Byte Escape Syntax

2010-04-15 Thread Howard Yeh
On Thu, Apr 15, 2010 at 10:45 AM, Tom Lane wrote: > Howard Yeh writes: >> Is Postgres's byte escape syntax something that could be set by the client? > > Well, indirectly --- it's affected by the standard_conforming_strings > setting. is this something that could be set at runtime? Does it apply

Re: [GENERAL] solaris tarballs and pl/java

2010-04-15 Thread John R Pierce
Alvaro Herrera wrote: ... 8.4.3 ... I'm jumping sideways and trying a different attack on my actual problem, which is building pl/java HEAD for 64bit solaris sparc w/ 8.4.3 and JDK 1.5.0_23... rather than building the entire postgres tree, I replicated the couple missing files from the 32bit

Re: [GENERAL] solaris tarballs and pl/java

2010-04-15 Thread John R Pierce
Andy Colson wrote: On 4/15/2010 11:59 AM, John R Pierce wrote: The tarball for 64bit 8.4.3 on Solaris Sparc is missing some ./pgxs/... files I seem to need to build pl/java. they exist in the 32bit version but at least of them, Makefile.global, appears quite build specific. So, it seem to be

[GENERAL] Limit postgres user logins

2010-04-15 Thread gvim
My hba file has: local all postgresmd5 hostall admin 127.0.0.1/32 md5 hostall dbuser127.0.0.1/32 md5 But that still allows users other than postgres to attempt to login as postgres. Is there

Re: [GENERAL] Limit postgres user logins

2010-04-15 Thread John R Pierce
gvim wrote: My hba file has: local all postgresmd5 hostall admin 127.0.0.1/32 md5 hostall dbuser127.0.0.1/32 md5 But that still allows users other than postgres to attempt to login as postgr

Re: [GENERAL] General Question about database -- redirection

2010-04-15 Thread Jorge Godoy
create database db_1 template db_2; This will create a new DB_1 using DB_2 as template. Otherwise, you'll change your code to connect to DB_2 instead of connecting to DB_1. -- Jorge Godoy On Thu, Apr 15, 2010 at 14:49, akp geek wrote: > dear all - > > I am not supposed to a

Re: Inserting multiple values, was Re: [GENERAL] solaris tarballs and pl/java

2010-04-15 Thread Scott Marlowe
On Thu, Apr 15, 2010 at 1:49 PM, Raymond O'Donnell wrote: > On 15/04/2010 20:44, Ozz Nixon wrote: >> Would this syntax work in PostgreSQL? >> >> |INSERT INTO MyTable (FirstCol, SecondCol) >> VALUES ('First',1), >> || ('||Second||',2),| >> | ('||Third||',3),| >> | ('||Fourth||',4),| >> | ('||Fifth|

Re: [GENERAL] General Question about database -- redirection

2010-04-15 Thread akp geek
Thank you On Thu, Apr 15, 2010 at 8:49 PM, Jorge Godoy wrote: > create database db_1 template db_2; > > This will create a new DB_1 using DB_2 as template. Otherwise, you'll > change your code to connect to DB_2 instead of connecting to DB_1. > > -- > Jorge Godoy > > > > On Thu, Apr 15, 20

[GENERAL] readline library not found

2010-04-15 Thread zhong ming wu
Dear List I need to build a postgres on a linux machine that I don't have root access. I built readline from source and installed it with prefix of /home/me/local readline library are in /home/me/local/lib and headers files are in /home/me/local/include/readline After explicitly specfying these

[GENERAL] Int64GetDatum

2010-04-15 Thread John R Pierce
I have compiled some C (pljava.c) for solaris sparc 64 bit, setup the LD_LIBRARY_PATH so postgres can find it, and try and load it. me=# CREATE FUNCTION sqlj.java_call_handler() RETURNS language_handler AS 'pljava'LANGUAGE C; ERROR: could not load library "/opt/mystuff/pljava/pljava.so":

Re: [GENERAL] Int64GetDatum

2010-04-15 Thread Tom Lane
John R Pierce writes: > I have compiled some C (pljava.c) for solaris sparc 64 bit, setup the > LD_LIBRARY_PATH so postgres can find it, and try and load it. > me=# CREATE FUNCTION sqlj.java_call_handler() RETURNS language_handler > AS 'pljava'LANGUAGE C; > ERROR: could not load library

Re: [GENERAL] readline library not found

2010-04-15 Thread Tom Lane
zhong ming wu writes: > I need to build a postgres on a linux machine that I don't have root access. > I built readline from source and installed it with prefix of /home/me/local If you don't have root you're going to be in for a lot of pain here. Linux is not designed to be friendly to libraries

Re: [GENERAL] Int64GetDatum

2010-04-15 Thread John R Pierce
Tom Lane wrote: John R Pierce writes: I have compiled some C (pljava.c) for solaris sparc 64 bit, setup the LD_LIBRARY_PATH so postgres can find it, and try and load it. me=# CREATE FUNCTION sqlj.java_call_handler() RETURNS language_handler AS 'pljava'LANGUAGE C; ERROR: cou