Re: [GENERAL] Single character bitfields

2008-08-20 Thread Andrew Maclean
On Thu, Aug 21, 2008 at 12:56 PM, Joshua Drake <[EMAIL PROTECTED]> wrote: > On Thu, 21 Aug 2008 12:40:29 +1000 > "Andrew Maclean" <[EMAIL PROTECTED]> wrote: > >> I have a large database and I want to have several fields (among many) >> that are single character fields (in fact they are bitfields).

Re: [GENERAL] Single character bitfields

2008-08-20 Thread Tom Lane
Ben <[EMAIL PROTECTED]> writes: > Out of curiosity, does postgres collapse multiple boolean columns to a > bitfield internally? No. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.

Re: [GENERAL] plpgsql - sorting result set

2008-08-20 Thread Bob Gobeille
On Aug 20, 2008, at 10:11 PM, Gobeille, Robert wrote: On Aug 20, 2008, at 7:37 PM, Merlin Moncure wrote: On Wed, Aug 20, 2008 at 7:20 PM, Robert Gobeille <[EMAIL PROTECTED]> wrote: Is it possible to sort a result set in plpgsql? That is, after building up the result set with RETURN NEXT fr

Re: [GENERAL] Single character bitfields

2008-08-20 Thread Ben
On Aug 20, 2008, at 7:56 PM, Joshua Drake wrote: I have a large database and I want to have several fields (among many) that are single character fields (in fact they are bitfields). boolean? Out of curiosity, does postgres collapse multiple boolean columns to a bitfield internally? In o

Re: [GENERAL] plpgsql - sorting result set

2008-08-20 Thread Bob Gobeille
On Aug 20, 2008, at 7:37 PM, Merlin Moncure wrote: On Wed, Aug 20, 2008 at 7:20 PM, Robert Gobeille <[EMAIL PROTECTED]> wrote: Is it possible to sort a result set in plpgsql? That is, after building up the result set with RETURN NEXT from multiple queries, I'd like to sort the set before

Re: [GENERAL] Single character bitfields

2008-08-20 Thread Joshua Drake
On Thu, 21 Aug 2008 12:40:29 +1000 "Andrew Maclean" <[EMAIL PROTECTED]> wrote: > I have a large database and I want to have several fields (among many) > that are single character fields (in fact they are bitfields). > > 1) Is char(1) the most efficient way to store these fields? If not > what is

[GENERAL] Single character bitfields

2008-08-20 Thread Andrew Maclean
I have a large database and I want to have several fields (among many) that are single character fields (in fact they are bitfields). 1) Is char(1) the most efficient way to store these fields? If not what is better? 2) I need to test the field against constants, e.g if the field is called source

Re: [GENERAL] ADO/ODBC returns TEXT fields as Varchar, not LongVarChar

2008-08-20 Thread Bill
Further testing has revealed that adding UnknownAsLongVarchar=1 to the connection string causes ADO to see TEXT fields as LongVarchar but it also causes all VARCHAR fields of any size to be seen as LongVarChar. Why is ADO or the ODBC driver seeing all Varchar and Text fields as type unknown? --

Re: [GENERAL] function SETOF return type with variable columns?

2008-08-20 Thread Tom Lane
"Merlin Moncure" <[EMAIL PROTECTED]> writes: > PostgreSQL functions are for the most part strictly bound to their > return type. There is, however, the trick of declaring the function as "returns record" and then specifying the names and types of the output columns in the calling query. I'm not s

Re: [GENERAL] function SETOF return type with variable columns?

2008-08-20 Thread Merlin Moncure
On Wed, Aug 20, 2008 at 12:59 PM, James Neff <[EMAIL PROTECTED]> wrote: > Greetings, > > Is it possible to have a function with a return type of SETOF that has > variable number of return columns? > > The input parameter for this function will be a String containing a number > of codes separated b

Re: [GENERAL] plpgsql - sorting result set

2008-08-20 Thread Merlin Moncure
On Wed, Aug 20, 2008 at 7:20 PM, Robert Gobeille <[EMAIL PROTECTED]> wrote: > Is it possible to sort a result set in plpgsql? > > That is, after building up the result set with RETURN NEXT from multiple > queries, I'd like to sort the set before returning. > > I'm still using 8.1 if that is an iss

Re: [GENERAL] order by x using varchar_pattern_ops

2008-08-20 Thread Tom Lane
"Scott Marlowe" <[EMAIL PROTECTED]> writes: > But is there a way to force a use of varchar_pattern_ops on a column > used in an order by? ORDER BY x USING ~<~("asc" direction) ORDER BY x USING ~>~("desc" direction) (assuming those are the right names of the operators, I'm too lazy to chec

Re: [GENERAL] WAL archiving to network drive

2008-08-20 Thread Tom Lane
Greg Smith <[EMAIL PROTECTED]> writes: > You also don't want to be the guy who has to explain why the database is > taking hours to come back up again after it crashed and has 4000 WAL > segments to replay, because archiving failed for a long time and prevented > proper checkpoints (ask Robert T

[GENERAL] ADO/ODBC returns TEXT fields as Varchar, not LongVarChar

2008-08-20 Thread Bill
I am new to PostgreSQL and running 8.3 on Windows. I am connecting using ADO and the ODBC driver. My connection string contains TextAsLongVarchar=1 and MaxLongVarcharSize=65536, however, my TEXT column is truncated at 255 bytes. What must I do to get ADO to recognize the TEXT field as a LongVarch

[GENERAL] plpgsql - sorting result set

2008-08-20 Thread Robert Gobeille
Is it possible to sort a result set in plpgsql? That is, after building up the result set with RETURN NEXT from multiple queries, I'd like to sort the set before returning. I'm still using 8.1 if that is an issue. Thanks, Bob Gobeille Hewlett Packard Open Source Program Office -- Sent via

Re: [GENERAL] Silent install 8.3 diiffers from 8.2

2008-08-20 Thread Blakely, Jerel (Mission Systems)
Well it is the administrator account running the install, don't think I could get any more privileged than that. Near as I can tell even though the message says check privileges, the installer really thinks there is another postgres running, however there is not. Even with previous installs wiped c

Re: [GENERAL] Fwd: Restarting with pg_ctl, users, and passwords.

2008-08-20 Thread Adrian Klaver
-- Original message -- From: "Matthew Pettis" <[EMAIL PROTECTED]> > So, since I run my CGI under a non-'postgres' user, is that the line > that would govern my authentication, and then fail me? Because I > thought with 'postgres' listed as the 3rd spot, this line wo

Re: [GENERAL] Silent install 8.3 diiffers from 8.2

2008-08-20 Thread Martin Gainty
Jerel- any chance of running the postgres start script under god rights e.g. runas /noprofile /user:mymachine\GOD net start PostsgreSQL ? Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the offici

Re: [GENERAL] Fwd: Restarting with pg_ctl, users, and passwords.

2008-08-20 Thread Matthew Pettis
So, since I run my CGI under a non-'postgres' user, is that the line that would govern my authentication, and then fail me? Because I thought with 'postgres' listed as the 3rd spot, this line would not apply, and would move on to a different governing rule... On Wed, Aug 20, 2008 at 4:21 PM, Adri

Re: [GENERAL] Fwd: Restarting with pg_ctl, users, and passwords.

2008-08-20 Thread Adrian Klaver
-- Original message -- From: "Matthew Pettis" <[EMAIL PROTECTED]> > would the 'ident sameuser' entry qualify as a 'some non-functional > authentication method'? Yes. Basically you only get one shot at each connection to satisfy the requirements of a pg_hba line. T

Re: [GENERAL] Fwd: Restarting with pg_ctl, users, and passwords.

2008-08-20 Thread Matthew Pettis
would the 'ident sameuser' entry qualify as a 'some non-functional authentication method'? On Wed, Aug 20, 2008 at 3:48 PM, Adrian Klaver <[EMAIL PROTECTED]> wrote: > > -- Original message -- > From: [EMAIL PROTECTED] (Adrian Klaver) >> -- Original me

Re: [GENERAL] Fwd: Restarting with pg_ctl, users, and passwords.

2008-08-20 Thread Adrian Klaver
-- Original message -- From: "Matthew Pettis" <[EMAIL PROTECTED]> > Below is the pg_hba.conf file exerpt (minus a lot of comments)... the > line starting '#host' was my attempt at opening up the db as wide as > possible just to see if i could get in somehow... > >

Re: [GENERAL] Fwd: Restarting with pg_ctl, users, and passwords.

2008-08-20 Thread Adrian Klaver
-- Original message -- From: [EMAIL PROTECTED] (Adrian Klaver) > -- Original message -- > From: "Matthew Pettis" <[EMAIL PROTECTED]> > > SOLVED. > > > > Yep, Restart was done. > > > > The issue turned out not to be with Postgresql

Re: [GENERAL] Fwd: Restarting with pg_ctl, users, and passwords.

2008-08-20 Thread Matthew Pettis
Below is the pg_hba.conf file exerpt (minus a lot of comments)... the line starting '#host' was my attempt at opening up the db as wide as possible just to see if i could get in somehow... --- pg_hba.conf -- # Database administrative login by UNIX sockets local

[GENERAL] order by x using varchar_pattern_ops

2008-08-20 Thread Scott Marlowe
OK, so I know about varchar_pattern_ops for things like matching with like in a non C locale. But is there a way to force a use of varchar_pattern_ops on a column used in an order by? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

Re: [GENERAL] Fwd: Restarting with pg_ctl, users, and passwords.

2008-08-20 Thread Adrian Klaver
-- Original message -- From: "Matthew Pettis" <[EMAIL PROTECTED]> > SOLVED. > > Yep, Restart was done. > > The issue turned out not to be with Postgresql config, but the app > config. In the app, I define a connection string, which has user, > password, and databa

Re: [GENERAL] Fwd: Restarting with pg_ctl, users, and passwords.

2008-08-20 Thread Martijn van Oosterhout
On Wed, Aug 20, 2008 at 01:58:37PM -0500, Matthew Pettis wrote: > Curious: Any ideas why I can leave the host off my connection string > in WinXP, but not Linux? It it an idiosyncracy of my app, or of > PostgreSQL? No host specified on a UNIX system means "unix domain socket" which is essentially

Re: [GENERAL] WAL archiving to network drive

2008-08-20 Thread Greg Smith
On Wed, 20 Aug 2008, Glen Parker wrote: Greg Smith wrote: 2) If there is a problem with the network drive, the slow/blocked network write is not happening where the database is waiting for it. This is not really a consideration, is it? I was under the impression that no other database activ

Re: [GENERAL] function SETOF return type with variable columns?

2008-08-20 Thread Pavel Stehule
Hello 2008/8/20 James Neff <[EMAIL PROTECTED]>: > Greetings, > > Is it possible to have a function with a return type of SETOF that has > variable number of return columns? > No. Number and result types have to be known in parse time. Use array without it. > The input parameter for this functio

Re: [GENERAL] Fwd: Restarting with pg_ctl, users, and passwords.

2008-08-20 Thread Matthew Pettis
SOLVED. Yep, Restart was done. The issue turned out not to be with Postgresql config, but the app config. In the app, I define a connection string, which has user, password, and databasename. When I had this same configuration on WinXP, I did not need to specify a fourth parameter, the host, wh

Re: [GENERAL] WAL archiving to network drive

2008-08-20 Thread Glen Parker
Greg Smith wrote: 2) If there is a problem with the network drive, the slow/blocked network write is not happening where the database is waiting for it. This is not really a consideration, is it? I was under the impression that no other database activity blocks waiting for the archiver. That

Re: [GENERAL] Fwd: Restarting with pg_ctl, users, and passwords.

2008-08-20 Thread Scott Marlowe
On Wed, Aug 20, 2008 at 11:38 AM, Matthew Pettis <[EMAIL PROTECTED]> wrote: > Hi Craig, > > Ok, I changed my pg_hba.conf from the commented line to the following > line to try to open things up for now (I know I will need more > security, but I'm trying to open things up wide to find the problem):

[GENERAL] function SETOF return type with variable columns?

2008-08-20 Thread James Neff
Greetings, Is it possible to have a function with a return type of SETOF that has variable number of return columns? The input parameter for this function will be a String containing a number of codes separated by a tilde character. I would like to have 1 output column for each of these co

Re: [GENERAL] Is the primary key constraint also an index?

2008-08-20 Thread Raymond O'Donnell
On 13/08/2008 03:18, Tim Uckun wrote: If I have a primary key constraint defined in the database do I also need to create an index on that field for fast lookup? As I understand it, creating a primary key on a table also creates an index automatically: testdb=# create table test(f1 integer,

Re: [GENERAL] SELECT query experts, anyone?

2008-08-20 Thread Mark Roberts
If you put this in the application, you could do something such as: my @manufacturers = fetch("select manufacturer_no, name from manufacturers"); my @select_fields = ('product_no'); foreach my $manufacturer (@manufacturers) { my $manuf_no = $manufacturer->{manufacturer_no}; my $name = $man

Re: [GENERAL] Silent install 8.3 diiffers from 8.2

2008-08-20 Thread Blakely, Jerel (Mission Systems)
Has this issue been resolved by anyone? I can install over and over manually but any attempt at silent install fails with the same. > "Service 'PostgreSQL Database Server 8.3' (pgsql-8.3) failed to start. > Verify that you have sufficient privileges to start system services." It works fine with 8

Re: [GENERAL] What's size of your PostgreSQL Database?

2008-08-20 Thread Mark Roberts
> Just out of curiosity, how do you replicate that amount of data? When I started working here, we used Slony-I to replicate our aggregate fact tables. A little over a year ago our data volume had grown to the point that the Slony was regularly unable to keep up with the data volume and around t

Re: [GENERAL] Fwd: Restarting with pg_ctl, users, and passwords.

2008-08-20 Thread Matthew Pettis
Hi Craig, Ok, I changed my pg_hba.conf from the commented line to the following line to try to open things up for now (I know I will need more security, but I'm trying to open things up wide to find the problem): --- pg_hba.conf # IPv4 local connections: #hostall

Re: [GENERAL] schema name in SQL statement.

2008-08-20 Thread Lennin Caro
--- On Tue, 8/19/08, Masis, Alexander (US SSA) <[EMAIL PROTECTED]> wrote: > From: Masis, Alexander (US SSA) <[EMAIL PROTECTED]> > Subject: [GENERAL] schema name in SQL statement. > To: pgsql-general@postgresql.org > Date: Tuesday, August 19, 2008, 10:52 PM > I have to explicitly specify the sch

Re: [GENERAL] Time of 'pg_ctl reload'.

2008-08-20 Thread hubert depesz lubaczewski
> If I make changes to the postgresql.conf and then do a 'pg_ctl reload', how > do I get the date & time of this event? it will be added in 8.4: http://www.depesz.com/index.php/2008/05/05/waiting-for-84-pg_conf_load_time-time-related-generate_series-and-enum-values-in-dt/ depesz -- Linkedin: h

Re: [GENERAL] schema name in SQL statement.

2008-08-20 Thread Scott Marlowe
On Wed, Aug 20, 2008 at 8:13 AM, Adrian Klaver <[EMAIL PROTECTED]> wrote: > From postgresql.conf.sample in ~pgsql/share: > > > #--- > # CLIENT CONNECTION DEFAULTS > #-

[GENERAL] negative values for vacuum threshold check !!!

2008-08-20 Thread Joao Ferreira gmail
Hello all While debugging my autovacuum I increased the level of logging to "debug3" and got this: # cat /var/pgsql/data/logfile | grep vac | egrep "mydb|mytable" LOG: autovacuum: processing database "mydb" DEBUG: mytbl: vac: 10409 (threshold 20), anl: -183366 (threshold 5) LOG: auto

[GENERAL] Time of 'pg_ctl reload'.

2008-08-20 Thread Alexi Gen
Thank you Michael! I have another question - related to this. If I make changes to the postgresql.conf and then do a 'pg_ctl reload', how do I get the date & time of this event? Cheers! Alexi Gen On Mon, Aug 18, 2008 at 03:53:32AM -0700, Alexi Gen wrote: > Is there a table/view available from

[GENERAL]

2008-08-20 Thread Alexi Gen
Thank you Michael! I have another question - related to this. If I make changes to the postgresql.conf and then do a 'pg_ctl reload', how do I get the date & time of this event? Cheers! Alexi Gen On Mon, Aug 18, 2008 at 03:53:32AM -0700, Alexi Gen wrote: > Is there a table/view available from

[GENERAL] Modeling tools

2008-08-20 Thread Kincaid, Larry
Hi, does anyone have any experience with MicroOLAP Database Designer for PostgreSQL? I've been looking at modeling tools and it appears there's really only a couple that support postgresql. CaseStudio2 *was* a pretty good tool but then it was acquired by Quest Software and became the Toad Data

Re: [GENERAL] schema name in SQL statement.

2008-08-20 Thread Adrian Klaver
On Tuesday 19 August 2008 9:53:11 pm johnf wrote: > On Tuesday 19 August 2008 04:01:55 pm Adrian Klaver wrote: > > -- Original message -- > > From: "Masis, Alexander (US SSA)" <[EMAIL PROTECTED]> > > > > > I have to explicitly specify the schema name to make SQL sta

[GENERAL] CREATE DOMAIN with referential integrity

2008-08-20 Thread regme please
HI all. Is there a way to CREATE a DOMAIN in v8.3 with a CHECK() predicate to ensure the value is in a dictionary table? Of course, I already know the trivial and ugly solution with a (PL/Pg)SQL lookup function. Thanks.

Re: [GENERAL] Fwd: Restarting with pg_ctl, users, and passwords.

2008-08-20 Thread Matthew Pettis
Thanks Craig and Tom, This is very helpful... once I troubleshoot accessing the database with the postgres user, I plan on adding other users with more restrictive credentials... I thought I'd start with this config just to see if I could get access on a very basic level. Off to google postgresql

Re: [GENERAL] pg_restore fails on Windows

2008-08-20 Thread Magnus Hagander
>>> 2.Our production PG version is 8.1.3. For some reasons it is not possible to >> upgrade to the LATEST; >>> I tested the libpq also on this version and it worked. Is it OK? I mean, did >> it worked by chance or the library >>> API & contracts didn't change between this version and latest? >> No

[GENERAL] Re: pg_restore fails on Windows

2008-08-20 Thread Tom Tom
Magnus Hagander wrote > Tom Tom wrote: > > Magnus Hagander wrote > >> Tom Lane wrote: > >>> =?us-ascii?Q?Tom=20Tom?= <[EMAIL PROTECTED]> writes: > Magnus Hagander wrote: > > Attached is a pg_restore.exe off CVS tip today, which should include the > > patch. Please try this one. >

Re: [GENERAL] Fwd: Restarting with pg_ctl, users, and passwords.

2008-08-20 Thread Craig Ringer
Matthew Pettis wrote: > I've created a database and can log into it and do stuff with the > tables using psql. However, I have a CGI app that wants to call the > database (all on the same machine), but gets a 'FATAL: Ident > authentication failed for user "postgres"' error. You *REALLY* shouldn'

Re: [GENERAL] [ADMIN] Regarding access to a user

2008-08-20 Thread Kevin Grittner
>>> Shashwat_Nigam <[EMAIL PROTECTED]> wrote: > Now what I want is to set privilege that whenever the user log in as Us > he can only see database Y, none other than that. The user Us could have all > rights for database Y but can't go for any other database (X or Z). The first thing you ne

Re: [GENERAL] SELECT query experts, anyone?

2008-08-20 Thread Tino Wildenhain
Teemu Juntunen wrote: Hi Experts, is threre any way to SELECT values in columns instead of rows? For example select products and their manufacters in the followin way: product1; manufacturer1; manufacturer2;,,, manufacturerN product2; manufacturer3; product3; manufacturer1;.. manufacturerN-

Re: [GENERAL] 8.3.3 win32 crashing

2008-08-20 Thread Alvaro Herrera
Tom Lane wrote: > Klint Gore <[EMAIL PROTECTED]> writes: > >>> [ heavy RAISE NOTICE traffic crashes the server ] > > > Tom Lane wrote: > >> Please try to narrow it down a little. > > > client=warning, log=warning completes > > client=warning, log=notice fails > > client=notice, log=warning comple

Re: [GENERAL] WAL archiving to network drive

2008-08-20 Thread Greg Smith
On Tue, 19 Aug 2008, Rob Adams wrote: Is it best to give the 'postgres' user network access & archive the WAL files directly to the network drive? Or archive the WAL files to a local folder and then use a scheduled task to move them to the network drive? I normally write first to a local driv

[GENERAL] SELECT query experts, anyone?

2008-08-20 Thread Teemu Juntunen
Hi Experts, is threre any way to SELECT values in columns instead of rows? For example select products and their manufacters in the followin way: product1; manufacturer1; manufacturer2;,,, manufacturerN product2; manufacturer3; product3; manufacturer1;.. manufacturerN-1 With a function you coul

[GENERAL] Sequences using libpqxx

2008-08-20 Thread Roshni Mani
Hi all, Does the sequence commands like nextval().setval(),curval() exist using libpqxx? Thanks and regards Roshni

Re: [GENERAL] What's size of your PostgreSQL Database?

2008-08-20 Thread Robert Gravsjö
Mark Roberts wrote: 1. 2.5-3TB, several others that are of fractional sisize. ... 5. They do pretty well, actually. Our aggregate fact tables regularly join to metadata tables and we have an average query return time of 10-30s. We do make some usage of denormalized mviews for chained/hier

Re: [GENERAL] pg_restore fails on Windows

2008-08-20 Thread Magnus Hagander
Tom Tom wrote: > Magnus Hagander wrote >> Tom Lane wrote: >>> =?us-ascii?Q?Tom=20Tom?= <[EMAIL PROTECTED]> writes: Magnus Hagander wrote: > Attached is a pg_restore.exe off CVS tip today, which should include the > patch. Please try this one. I tested the restore using the provide

[GENERAL] Re: Re: pg_restore fails on Windows

2008-08-20 Thread Tom Tom
Magnus Hagander wrote > Tom Lane wrote: > > =?us-ascii?Q?Tom=20Tom?= <[EMAIL PROTECTED]> writes: > >> Magnus Hagander wrote: > >>> Attached is a pg_restore.exe off CVS tip today, which should include the > >>> patch. Please try this one. > > > >> I tested the restore using the provided pg_restore.

[GENERAL] Regarding access to a user

2008-08-20 Thread Shashwat_Nigam
Dear Team First of all I would like to thank you to provide a spatial database fro GIS developers and user. But I have doubt in the usage. I have created a few databases (i.e. X, Y, Z) in a default Server and I also created a user (i.e. Us). Now what I want is to set privilege that whenever th

Re: [GENERAL] cache lookup failed

2008-08-20 Thread Albe Laurenz
c k wrote: > I got following error while testing some newly created functions. > > > ERROR: cache lookup failed for function 111462 > CONTEXT: PL/pgSQL function "uf_postdoc" line 25 at FOR over > SELECT rows > > ** Error ** > > ERROR: cache lookup failed for function 111462 >