[GENERAL] Date / interval question

2008-04-10 Thread kevin kempter
Hi List; I'm populating a time dimension. I need to get the number of days since the start of the fiscal year and also the number of months since the start of the fiscal year based on the current 'date' being processed. Example: my current process date is 01/01/2007 start date of fiscal

Re: [GENERAL] pgcrypto and dblink

2008-04-10 Thread Chris Browne
[EMAIL PROTECTED] ("Roberts, Jon") writes: > I am moving from Windows to Solaris and I need pgcrypto and dblink. > Where are these? I don't see anything in the configure that suggests it > is even an option. They are part of the set of "contrib" functions. You head to directory "contrib", and, i

Re: [GENERAL] Way to shutdown/freeze/stop an individual database without taking postmaster down?

2008-04-10 Thread Chris Browne
[EMAIL PROTECTED] ("W S") writes: > I was asked this question, and I wasn't sure if it is possible: > > > do you know of a way to stop just one database (not delete/drop) on > our PostgreSQL 8.1 server? > > > And, while I know how to shut down postmaster, and/or put in rules to > pg_hba.conf to lim

Re: [GENERAL] Can´t connect but listen address and pg_hba configured correctly

2008-04-10 Thread Scott Marlowe
On Thu, Apr 10, 2008 at 3:00 PM, Marcelo de Moraes Serpa <[EMAIL PROTECTED]> wrote: > Thank you for the replies, > > Actually I did not change the port number. For some bizarre reason, the > pgsql 8.1 debian package comes with port 5433 pre-configured and this was > exactly was causing the problem,

Re: [GENERAL] Can´t conne ct but listen address and pg_hba configured correctly

2008-04-10 Thread Martijn van Oosterhout
On Thu, Apr 10, 2008 at 06:00:30PM -0300, Marcelo de Moraes Serpa wrote: > Thank you for the replies, > > Actually I did not change the port number. For some bizarre reason, the > pgsql 8.1 debian package comes with port 5433 pre-configured and this was > exactly was causing the problem, of course

Re: [GENERAL] Can´t connect but listen address and pg_hba configured correctly

2008-04-10 Thread Marcelo de Moraes Serpa
Thank you for the replies, Actually I did not change the port number. For some bizarre reason, the pgsql 8.1 debian package comes with port 5433 pre-configured and this was exactly was causing the problem, of course, I wasn't noting that the port was different, but they are so similar (that's what

Re: [GENERAL] pgcrypto and dblink

2008-04-10 Thread Roberts, Jon
> > I am moving from Windows to Solaris and I need pgcrypto and dblink. > > Where are these? I don't see anything in the configure that suggests > it > > is even an option. > > They're not handled by 'configure'. They are in the 'contrib' > directory in the source tree, and you install them by

Re: [GENERAL] Can´t connect but listen addr ess and pg_hba configured correctly

2008-04-10 Thread Kyle Wilcox
Did you purposely change the default port? Are you specifying the change in pgadmin? If the pg_hba.conf file is the problem, pgadmin will tell you with a message like: FATAL: no pg_hba.conf entry for host "IPADDRESS", user "USER", database "DATABASE", SSL ON/OFF Are you getting a similar m

Re: [GENERAL] Can´t connect but listen address and pg_hba configured correctly

2008-04-10 Thread Joey K.
On Thu, Apr 10, 2008 at 1:26 PM, Marcelo de Moraes Serpa < [EMAIL PROTECTED]> wrote: > I can´t connect to my postgresql8.1 server running on Debian. The pgadmin > client says it can't connect. I already edited the pg_hba.conf and > postgresql.conf (listen_addresses = '*' and port) but the problem

Re: [GENERAL] how to use transaction isolation

2008-04-10 Thread Jan de Visser
On 4/10/08, Gong <[EMAIL PROTECTED]> wrote: > > > In the java code below, I set the transaction isolation to serialization. > > public class IsolationTest { > > private static String select = "select * from tmp where url = 'aaa'"; > > public static void main(String[] args) throws Exception{

Re: [GENERAL] pgcrypto and dblink

2008-04-10 Thread Douglas McNaught
On Thu, Apr 10, 2008 at 3:46 PM, Roberts, Jon <[EMAIL PROTECTED]> wrote: > I am moving from Windows to Solaris and I need pgcrypto and dblink. > Where are these? I don't see anything in the configure that suggests it > is even an option. They're not handled by 'configure'. They are in the 'con

Re: [GENERAL] pgcrypto and dblink

2008-04-10 Thread Rodrigo Gonzalez
Roberts, Jon escribió: I am moving from Windows to Solaris and I need pgcrypto and dblink. Where are these? I don't see anything in the configure that suggests it is even an option. Jon They are contribs, you have to install them after pgsql smime.p7s Description: S/MIME Cryptographic

[GENERAL] Can´t connect but listen address and pg_hba configured correctly

2008-04-10 Thread Marcelo de Moraes Serpa
I can´t connect to my postgresql8.1 server running on Debian. The pgadmin client says it can't connect. I already edited the pg_hba.conf and postgresql.conf (listen_addresses = '*' and port) but the problem remains, pg_admin is running on a XP machine without Firewalls enabled, Debian is also not

[GENERAL] pgcrypto and dblink

2008-04-10 Thread Roberts, Jon
I am moving from Windows to Solaris and I need pgcrypto and dblink. Where are these? I don't see anything in the configure that suggests it is even an option. Jon -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.o

Re: [GENERAL] Way to shutdown/freeze/stop an individual database without taking postmaster down?

2008-04-10 Thread Erik Jones
On Apr 10, 2008, at 2:37 PM, Craig Ringer wrote: I haven't checked whether pg_hba.conf rules are reloaded, but `pg_ctl reload' can re-read some settings without a postmaster restart. So you might be able to disallow access in pg_hba then reload. I'd be curious to know if that works and if/how i

[GENERAL] how to use transaction isolation

2008-04-10 Thread Gong
In the java code below, I set the transaction isolation to serialization. public class IsolationTest { private static String select = "select * from tmp where url = 'aaa'"; public static void main(String[] args) throws Exception{ //ConncetionFactory is a factory class for managi

Re: [GENERAL] percentile rank query

2008-04-10 Thread Sam Mason
On Thu, Apr 10, 2008 at 05:20:21PM +0100, William Temperley wrote: > SELECT count(*) AS frequency, score, > SELECT count(uid) FROM scoretable st2 WHERE st2.score <= > st1.score) - count(*)) + (count(*)/2))::float/(select > count(*) from scoretable)) > > FROM scoretable st1 > GROUP BY score > O

Re: [GENERAL] Way to shutdown/freeze/stop an individual database without taking postmaster down?

2008-04-10 Thread Craig Ringer
W S wrote: > Greetings, > > I was asked this question, and I wasn't sure if it is possible: > > > do you know of a way to stop just one database (not delete/drop) on > our PostgreSQL 8.1 server? One possible way: You can update its pg_database record, setting datallowconn to 'f' to disable new

Re: [GENERAL] Way to shutdown/freeze/stop an individual database without taking postmaster down?

2008-04-10 Thread Ben
What do you hope to get out of this that you wouldn't get out of locking out access? On Thu, 10 Apr 2008, W S wrote: Greetings, I was asked this question, and I wasn't sure if it is possible: do you know of a way to stop just one database (not delete/drop) on our PostgreSQL 8.1 server? An

Re: [GENERAL] how to use postgre sql from inside process

2008-04-10 Thread Douglas McNaught
On Thu, Apr 10, 2008 at 11:25 AM, Scott Marlowe <[EMAIL PROTECTED]> wrote: > On Thu, Apr 10, 2008 at 5:45 AM, CMOS <[EMAIL PROTECTED]> wrote: > > hi, > > i would like to get services of postgresql from inside the process (to > > use it as a library and linking to it), i.e not having a separate

[GENERAL] Way to shutdown/freeze/stop an individual database without taking postmaster down?

2008-04-10 Thread W S
Greetings, I was asked this question, and I wasn't sure if it is possible: do you know of a way to stop just one database (not delete/drop) on our PostgreSQL 8.1 server? And, while I know how to shut down postmaster, and/or put in rules to pg_hba.conf to limit access to a certain database, is

[GENERAL] ODBCng vs psqlODBC

2008-04-10 Thread Bruno Lavoie
Hello, they're the 2 available ODBC drivers for PG, which one is better to use. If they're equals, what are the circumstances to use one over the other. Thanks Bruno Lavoie -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.p

Re: [GENERAL] percentile rank query

2008-04-10 Thread William Temperley
On Thu, Apr 10, 2008 at 4:36 PM, Osvaldo Rosario Kussama <[EMAIL PROTECTED]> wrote: > > Try: > > SELECT count(*) AS frequency, score, > count((SELECT * FROM scoretable st2 WHERE st2.score <= st1.score)) AS > runningtotal > FROM scoretable st1 > GROUP BY score > ORDER BY score > > Osvaldo >

Re: [GENERAL] select statement fails

2008-04-10 Thread Tom Lane
"Andrus" <[EMAIL PROTECTED]> writes: > 1. SQL assumes that CHARACTER(n) column is always padded with spaces in > right. > So casting to text should preserve spaces. No, it should not. In CHAR(n), trailing spaces are semantically insignificant; 'foo' and 'foo ' are considered equal. In TEXT they

Re: [GENERAL] select statement fails

2008-04-10 Thread Erik Jones
On Apr 10, 2008, at 3:13 AM, Andrus wrote: Albe, select * from test where tc=' '::text; Because the arguments to the operator "=" are of different type, implicit type conversion takes place. "character(1)" will by converted to "text", during this conversion trailing blanks will be ignored, as

Re: [GENERAL] select statement fails

2008-04-10 Thread Martijn van Oosterhout
On Thu, Apr 10, 2008 at 11:13:33AM +0300, Andrus wrote: > 1. SQL assumes that CHARACTER(n) column is always padded with spaces in > right. > So casting to text should preserve spaces. > Why PostgreSQL cast to text violates SQL ? It says it is padded with spaces, but it also says that these spaces

Re: [GENERAL] Proper Installation of Postgres and Postgis on 10.5 Intel

2008-04-10 Thread Shane Ambler
Stefan Schwarzer wrote: I tried now for weeks to get postgres & postgis going on my machine, in vain... Lots of frustration has been built up, lots of energy went into it... But nothing goes... I mean, postgres is running, postgis is installed, but it constantly craches, doesn't accept shp2pgsq

Re: [GENERAL] percentile rank query

2008-04-10 Thread Osvaldo Rosario Kussama
William Temperley escreveu: Hi all I'm trying to calculate the percentile rank for a record based on a 'score' column, e.g. a column of integers such as: 23,77,88,23,23,23,12,12,12,13,13,13 without using a stored procedure. So, select count(*) as frequency, score from scoretable group by score

Re: [GENERAL] how to use postgre sql from inside process

2008-04-10 Thread Scott Marlowe
On Thu, Apr 10, 2008 at 5:45 AM, CMOS <[EMAIL PROTECTED]> wrote: > hi, > i would like to get services of postgresql from inside the process (to > use it as a library and linking to it), i.e not having a separate > postgresql process and communicating with it. Is this possible? No. > if possibl

Re: [GENERAL] Disable Triggers

2008-04-10 Thread Terry Lee Tucker
On Wednesday 09 April 2008 14:56, Greg Sabino Mullane wrote: > > I see the following in the documentation for pg_trigger related > > to tgenabled: "Controls in which session_replication_role modes the > > trigger fires. O = trigger fires in "origin" and "local" modes, > > D = trigger is disabled, R

Re: [GENERAL] slow pgsql tables - need to vacuum?

2008-04-10 Thread Dan99
On Apr 7, 11:14 am, [EMAIL PROTECTED] (Alan Hodgson) wrote: > On Monday 07 April 2008, Dan99 <[EMAIL PROTECTED]> wrote: > > > Does TRUNCATE TABLE keep all necessary table > > information such as indexes, constraints, triggers, rules, and > > privileges? > > Yes. It does require an exclusive lock on

Re: [GENERAL] select statement fails

2008-04-10 Thread Andrus
Albe, >> select * from test where tc=' '::text; >Because the arguments to the operator "=" are of different type, >implicit type conversion takes place. >"character(1)" will by converted to "text", during this conversion >trailing blanks will be ignored, as befits the "character(n)" type. Thank y

[GENERAL] how to use postgre sql from inside process

2008-04-10 Thread CMOS
hi, i would like to get services of postgresql from inside the process (to use it as a library and linking to it), i.e not having a separate postgresql process and communicating with it. Is this possible? if possible what are the impact on licensing. thank you -- Sent via pgsql-general mailing l

Re: [GENERAL] pl/java on Solaris

2008-04-10 Thread Tom Lane
Volkan YAZICI <[EMAIL PROTECTED]> writes: > On Thu, 10 Apr 2008, "Roberts, Jon" <[EMAIL PROTECTED]> writes: >> I don't see a pljava file in my share directory like I do on Windows. >> Is pl/java not included when compiling from source? > PL/java[1] is a separate PL project, not builtin to PostgreS

Re: [GENERAL] begin transaction locks out other connections

2008-04-10 Thread Pavan Deolasee
On Thu, Apr 10, 2008 at 7:18 PM, Ivano Luberti <[EMAIL PROTECTED]> wrote: > Anyway I am a little surprised by this thing cause I thought that in a case > like this the habgs should happen only at commit/rollback time. > I think that's because Postgres does not have deferred constraint checks. Th

[GENERAL] Proper Installation of Postgres and Postgis on 10.5 Intel

2008-04-10 Thread Stefan Schwarzer
I tried now for weeks to get postgres & postgis going on my machine, in vain... Lots of frustration has been built up, lots of energy went into it... But nothing goes... I mean, postgres is running, postgis is installed, but it constantly craches, doesn't accept shp2pgsql imports etc... S

Re: [GENERAL] visibility rule in a EXECUTE with multi sql

2008-04-10 Thread Tom Lane
laser <[EMAIL PROTECTED]> writes: > when I do a: > execute 'set search_path to bar; create table foo(f1 int);insert into > table foo blah..blah;' > in plpgsql, I found that the insert statement always report that "can't > found table foo" or something > like that. Well, yeah. The whole stri

[GENERAL] percentile rank query

2008-04-10 Thread William Temperley
Hi all I'm trying to calculate the percentile rank for a record based on a 'score' column, e.g. a column of integers such as: 23,77,88,23,23,23,12,12,12,13,13,13 without using a stored procedure. So, select count(*) as frequency, score from scoretable group by score order by score Yields: frequ

Re: [GENERAL] begin transaction locks out other connections

2008-04-10 Thread Ivano Luberti
Richard, I was convinced that it was not necessary to provide detailed SQL to not introduce any noise in the information I was giving to the list. Anyway you proved right at last, since trying to sample some sql to make others able to reproduce the problem we were also able to identify the cause

Re: [GENERAL] pl/java on Solaris

2008-04-10 Thread Volkan YAZICI
On Thu, 10 Apr 2008, "Roberts, Jon" <[EMAIL PROTECTED]> writes: > I am migrating an 8.3 database from Windows to Solaris. We are using > pl/java and I went through the installation process for this on Windows. > > I'm building Solaris from the source and when running ./configure, I > don't see a

Re: [GENERAL] pl/java on Solaris

2008-04-10 Thread Zdenek Kotala
Roberts, Jon napsal(a): I don't see a pljava file in my share directory like I do on Windows. Is pl/java not included when compiling from source? pl/java is not part of core like pl/pgPerl... You need to download it separately from http://pgfoundry.org/projects/pljava/ Zden

Re: [GENERAL] pl/java on Solaris

2008-04-10 Thread Richard Broersma
On Thu, Apr 10, 2008 at 5:31 AM, Roberts, Jon <[EMAIL PROTECTED]> wrote: > I am migrating an 8.3 database from Windows to Solaris. We are using > pl/java and I went through the installation process for this on Windows. > > I'm building Solaris from the source and when running ./configure, I > don'

[GENERAL] pl/java on Solaris

2008-04-10 Thread Roberts, Jon
I am migrating an 8.3 database from Windows to Solaris. We are using pl/java and I went through the installation process for this on Windows. I'm building Solaris from the source and when running ./configure, I don't see a switch to include pl/java. Java is in my path too so it should allow me

Re: [GENERAL] howto set a variable in transaction context

2008-04-10 Thread Thomas Markus
thanks, it works A. Kretschmer schrieb: am Thu, dem 10.04.2008, um 13:32:04 +0200 mailte Thomas Markus folgendes: hi list, how can i set a variable, which content is only visible in current transaction? i know the way to create a temp table with create temp table ... on commit drop but

Re: [GENERAL] Write in file from postgres

2008-04-10 Thread Albe Laurenz
Kevin Martins wrote: > Hello everybody, > First off all I am new in postgres but allready got some questions. It's > possible to wirte in a file from postgres? First off, if you write to a mailing list you should first learn how to write an e-mail. Really. Core PostgreSQL does not have such a fu

Re: [GENERAL] howto set a variable in transaction context

2008-04-10 Thread A. Kretschmer
am Thu, dem 10.04.2008, um 13:32:04 +0200 mailte Thomas Markus folgendes: > hi list, > > how can i set a variable, which content is only visible in current > transaction? > i know the way to create a temp table with > > create temp table ... on commit drop > > but i dont like that way. somethi

[GENERAL] howto set a variable in transaction context

2008-04-10 Thread Thomas Markus
hi list, how can i set a variable, which content is only visible in current transaction? i know the way to create a temp table with create temp table ... on commit drop but i dont like that way. something like | set_config(setting_name, new_value, is_local) is it possible? regards thomas |

Re: [GENERAL] Dump/Transfer Sequence Problems

2008-04-10 Thread Stefan Schwarzer
I am using Navicat to transfer data from one database to another. But it soon gives me an error message like the following: I think you'll probably have to ask the navicat people. If you want to use pg_dump to transfer data from 8.1 to 8.2 though, use the version of pg_dump that ships with 8

Re: [GENERAL] include PostgreSQL utilities into 3rd party program package

2008-04-10 Thread Shane Ambler
Michael Raven wrote: Hello everybody. I've got some kind of PostgreSQL copyright related question. Our company is developing an commercial product for PostgreSQL administration. We want to include some utilities (i.e. pg_dump.exe, pg_restore.exe etc) from PostgreSQL for Windows installation pac

[GENERAL] visibility rule in a EXECUTE with multi sql

2008-04-10 Thread laser
hi all, when I do a: execute 'set search_path to bar; create table foo(f1 int);insert into table foo blah..blah;' in plpgsql, I found that the insert statement always report that "can't found table foo" or something like that. I guess it's visibility rule in PostgreSQL, but I can't found cl

Re: [GENERAL] connecting VB to postgreSQL

2008-04-10 Thread Abhishek MANDHANA
In any case, it's obvious in your screenshot that you left the "server" and "location" fields blank in the connection setup form. This is most likely the cause of your problem. *doesnt work either..OLE-DB error persists. thanks for the readmefile. * On Wed, Apr 9, 2008 at 8:04 PM, Craig Ringer <[E