Re: [GENERAL] Let's Do the CoC Right

2016-01-22 Thread Oliver Elphick
(Replying to the digest post) Having watched this discussion from the start, I think the project would be better off without any CoC.  The list has always been conducted well and if something isn't broken you shouldn't try to fix it. -- Oliver Elphick Lincolnshire, England -- Sent

Re: [GENERAL] Nested window functions not permitted

2015-11-08 Thread Oliver Elphick
On Sun, 2015-11-08 at 17:50 -0500, Tom Lane wrote: > Oliver Elphick writes: > > I tried to do this: > > SELECT p.company, p.start, p.yearend, p.idnum, > >s.pdno, s.pdend, > >CASE WHEN nth_value(s.pdend,(row_number() OVER w)::INTE

[GENERAL] Nested window functions not permitted

2015-11-08 Thread Oliver Elphick
I tried to do this: SELECT p.company, p.start, p.yearend, p.idnum, s.pdno, s.pdend, CASE WHEN nth_value(s.pdend,(row_number() OVER w)::INTEGER -1) OVER w IS NULL THEN p.start ELSE nth_value(s.pdend,(row_number() OVER w)::INTEGER -1) + '1

Re: [GENERAL] localtime ?

2015-06-15 Thread Oliver Elphick
On 15/06/15 20:44, James Cloos wrote: >> "AK" == Adrian Klaver writes: > > AK> So what is at line 508 in /etc/postgresql/9.3/main/postgresql.conf? > > timezone = 'localtime' > > That is the same in the 9.4 conf, where everything defaults to utc as I > desire. > > Those are Debian's default

Re: [GENERAL] How to skip duplicate records while copying from CSV to table in Postgresql using "COPY"

2015-05-24 Thread Oliver Elphick
On Sun, 2015-05-24 at 18:25 +0630, Arup Rakshit wrote: > > > > Assuming you are using Unix, or can install Unix tools, run the input > > files through > > > > sort -u > > > > before passing them to COPY. > > > > Oliver Elphick > >

Re: [GENERAL] How to skip duplicate records while copying from CSV to table in Postgresql using "COPY"

2015-05-24 Thread Oliver Elphick
is the best solution here. Can anybody suggest which approach > should I adopt ? Or if any better ideas you guys have on this task, > please share. Assuming you are using Unix, or can install Unix tools, run the input files through sort -u before passing them to COPY. Oliver Elphick

Re: [GENERAL] noobie join question

2015-05-11 Thread Oliver Elphick
On Mon, 2015-05-11 at 06:46 -0400, Steve Clark wrote: > Hi List, > I am having trouble trying to figure out > how to get the result listed at the bottom. > > I have 3 tables units, types of units which has a description of the units, > and a table that list associations of the units. I can't figur

Re: [GENERAL] Collation problem?

2015-04-26 Thread Oliver Elphick
On Sun, 2015-04-26 at 12:39 +0200, Bjørn T Johansen wrote: > > CREATE COLLATION nb_NO (LOCALE = nb_NO.utf8) > > But then I get this: > > ERROR: could not create locale "nb_no.utf8": No such file or > directory > DETAIL: The operating system could not find any locale data for the > locale name

Re: [GENERAL] Collation problem?

2015-04-26 Thread Oliver Elphick
t; (tried without the varchar also..) ALTER [ COLUMN ] column_name [ SET DATA ] TYPE data_type [ COLLATE collation ] [ USING expression ] You need to add the TYPE key word, I think. Oliver Elphick -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subsc

Re: [GENERAL] Postgres won't start

2013-08-09 Thread Oliver Elphick
On 9 August 2013 02:49, Tom Lane wrote: > > I wonder whether we shouldn't change the syslogger to emit something to > stderr when it takes over logging, saying "logging is now redirected to > ". > > Shouldn't you also, or instead, log to stderr just before leaving it, in case the configuration of

Re: [GENERAL] Postgres won't start

2013-08-08 Thread Oliver Elphick
it is getting as far as reading the configuration files - that is not mentioned in the log. There is no other instance of postgres running. On 9 August 2013 00:59, Oliver Elphick wrote: > To start with, it worked but the pg_hba.conf entry appeared to be wrong. > I tried changing that and t

[GENERAL] Postgres won't start

2013-08-08 Thread Oliver Elphick
Linux Mint (from Ubuntu) version 9.1. Postgres will no longer start, but I cannot find out why. Command line: $ /usr/lib/postgresql/9.1/bin/pg_ctl start -D /home/postgresql/9.1/main -l /var/log/postgresql/postgresql-9.1-main.log -s -w -o '-c config_file="/etc/postgresql/9.1/main/postgresql.conf"'

Re: [GENERAL] Suppress checking of chmod 700 on data-dir?

2007-06-07 Thread Oliver Elphick
ess where you don't want postgres to go. -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3

Re: [GENERAL] Inheritance and shared sequence

2007-06-07 Thread Oliver Elphick
; Well, if you *always* use the sequence you'll be OK (until you run out > of numbers), but it won't stop you manually supplying your own values. If you must keep the primary key unique across a set of tables, you need to create another table to index the keys and record which table eac

Re: [GENERAL] Running v8.1 amd v8.2 at the same time for a transition

2007-06-06 Thread Oliver Elphick
On Wed, 2007-06-06 at 14:11 +0200, Vincenzo Romano wrote: > On Wednesday 06 June 2007 13:41:12 Oliver Elphick wrote: > > Any suggestions for improvement? > > As far as "running two or more versions of the PGSQL server in the same > machine", I don't see solutions

Re: [GENERAL] Running v8.1 amd v8.2 at the same time for a transition

2007-06-06 Thread Oliver Elphick
one version is installed simultaneously (which will normally only happen while upgrade testing is going on) or unless the system is hosting multiple separate databases; in the latter case I imagine that most users are either guided by scripts or confined by an applica

Re: [GENERAL] Running v8.1 amd v8.2 at the same time for a transition

2007-06-05 Thread Oliver Elphick
y posted this question to the KUbuntu team with no answer in 14+ > hours. > > Is there anyone with a good hint? man pg_wrapper psql --cluster 8.1/main -d your_database -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight ht

Re: [GENERAL] Foreign keys and indexes

2007-06-05 Thread Oliver Elphick
On Tue, 2007-06-05 at 17:07 +0200, Marc Compte wrote: > > For instance, in the implementation of a N:M relationship, declaring > the > primary as (foreign1, foreign2) will create two indexes? or just one? Just one -- Oliver Elphick [EMA

Re: [GENERAL] Can someone have a look at my pg_hba.conf file ?

2007-06-05 Thread Oliver Elphick
og for details. > > Can someone help me out ? > > Thanks ! > > Steven > > ---(end of broadcast)--- > TIP 6: explain analyze is your friend -- Oliver Elphick [EMAIL PROT

Re: [GENERAL] jdbc pg_hba.conf error

2007-05-31 Thread Oliver Elphick
ith a different pg_hba.conf, listening on port 5432 on 127.0.0.1. -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8

Re: [GENERAL] Problem - any password accepted

2007-05-30 Thread Oliver Elphick
On Wed, 2007-05-30 at 19:38 +0200, Martijn van Oosterhout wrote: > On Wed, May 30, 2007 at 05:58:24PM +0100, Oliver Elphick wrote: > > While experimenting just now, I seem to have found a weird problem with > > passwords, in that _anything_ I type in is accepted as a valid password

Re: [GENERAL] jdbc pg_hba.conf error

2007-05-30 Thread Oliver Elphick
gt; > On Wed, 30 May 2007, Oliver Elphick wrote: > > > On Wed, 2007-05-30 at 18:35 +0200, Martijn van Oosterhout wrote: > >> On Wed, May 30, 2007 at 12:30:38PM -0400, Bhavana.Rakesh wrote: > >>> Oliver, > >>> > >>> When I do a : > >&

[GENERAL] Problem - any password accepted

2007-05-30 Thread Oliver Elphick
0 17:55:02 BST FATAL: password authentication failed for user "olly" but it has still let me in. -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631

Re: [GENERAL] jdbc pg_hba.conf error

2007-05-30 Thread Oliver Elphick
55.255.255.255 trust hosttesting123 brakesh 127.0.0.1 255.255.255.255 trust So it seems to me he did have it configured. In fact the first host line should be used and the second one for user brakesh is redundant, since it comes later in the file. The only thing I can see i

Re: [GENERAL] jdbc pg_hba.conf error

2007-05-30 Thread Oliver Elphick
ot;127.0.0.1", user > "brakesh", database "testing123", SSL off What happens if you change "host" to "hostnossl" in pg_hba.conf? (Seeing that that error message specifies that SSL is off.) Please remember to SIGHUP or restart the postmaster after changing

Re: [GENERAL] jdbc pg_hba.conf error

2007-05-30 Thread Oliver Elphick
Using this pg_hba.conf ought to give you the message: FATAL: missing or erroneous pg_hba.conf file if you try to connect from psql. I don't know if the Java stuff somehow manages to bypass it or if you haven't done a kill -SIGHUP of the postmaster to reload the configuration. -- Oliver

Re: [GENERAL] Geographic data sources, queries and questions

2007-05-29 Thread Oliver Elphick
ands [US Post Office] and also the Indian abbreviation for Maharashtra [Wikipedia]. In such a case I would always make the country code part of the primary key and not just an attribute. Again this saves your having to invent a new set of codes when one exists already. -- Oliver

Re: [GENERAL] postgres - oid question

2007-05-24 Thread Oliver Elphick
table_name (...) WITH OIDS; To have all tables created with oids, set the config parameter default_with_oids to true. (It defaults to false from 8.1 onwards.) Oliver Elphick ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner w

Re: [GENERAL] sequence problem - many rows

2005-11-29 Thread Oliver Elphick
oupmembers(groupid) values(55);". > The error is : ERROR: duplicate key violates unique constraint > "cachedgroupmembers_pkey" That was because the sequence was trying to reuse one of the 700,000 values you just loaded. -- Oliver Elphick

Re: [GENERAL] Can this pl/pgsql be simplified?

2005-11-28 Thread Oliver Elphick
END IF; ELSIF OLD.active <> NEW.active then update members set items_approved=items_approved+(CASE WHEN NEW.active THEN 1 ELSE -1 END) where id=NEW.member_id; END IF; -- Oliver Elphick

Re: [GENERAL] Upgrading from 8.0 to 8.1 on Debian

2005-11-18 Thread Oliver Elphick
that 8.1/main is the default. Check that it is working and then use pg_dropcluster to destroy the old one. These commands have to be run as root; postgres does not have sufficient permissions to modify the configuration files. -- Oliver Elphick olly@lfix.c

Re: [GENERAL] Linking

2005-11-01 Thread Oliver Elphick
ey on specification.fluid_id, if updates are allowed to change the value of process.fluid_id. Similarly, if process records can be deleted, you probably need to specify ON DELETE CASCADE. Maybe too you want to add a reverse foreign key on process.fluid_id; if so it would have to be DEFERRABL

Re: [GENERAL] Dumb Questions - upgrade notes?

2005-11-01 Thread Oliver Elphick
't seem to find them... The release notes are included in the manual for each new version. -- Oliver Elphick olly@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E

Re: [GENERAL] function DECODE and triggers

2005-10-26 Thread Oliver Elphick
On Tue, 2005-10-25 at 18:31 +0200, Rafael Montoya wrote: > Thanks for your answer, and if i have many options like > > decode (pre.C_EST,'01','U','02','M','03','W','04','D','05','O','06','S','') > as Est > > do i have to write many else options in this way? > > select case when pre.C_EST = '01'

Re: [GENERAL] Why different execution times for different instances for the

2005-10-25 Thread Oliver Elphick
cross them. > > Can you please let me know if you have experienced the same and how do > you resolved it. > > Thank you, > Kishore. No, I haven't seen anything like that. I am forwarding this mail to the general enquiries list, in case anyone else can help. -- Olive

Re: [GENERAL] newbie question: reading sql commands from script

2005-10-25 Thread Oliver Elphick
here are command line options: psql -f filename or redirection: psql < filename (the former gives line numbers), or for a single command: psql -c "sql command" -- Oliver Elphick olly@lfix.co.uk Isle of Wight h

Re: [GENERAL] pl/pgsql help

2005-10-25 Thread Oliver Elphick
gt; so any help would be appreciated. CREATE LANGUAGE plpgsql; If you do that in the template1 database, every database created thereafter will have it installed from scratch. -- Oliver Elphick olly@lfix.co.uk Isle of Wight

Re: [GENERAL] function DECODE and triggers

2005-10-25 Thread Oliver Elphick
ON table_product FOR EACH ROW EXECUTE PROCEDURE trig(); In trig() you need to make the action conditional: IF NEW.column2 <> OLD.column2 OR (NEW.column2 IS NULL) <> (OLD.column2 IS NULL) THEN ... END IF; (assuming it&#x

Re: [GENERAL] Newbie Questions

2005-10-24 Thread Oliver Elphick
so setting up a server means telling PgAdmin where to find the server you want to connect to. You should do it as the user who is going to be using PgAdmin. ... You do not generally need to use the postgres username; you can set up your own username as a PostgreSQL superuser and then you

Re: [GENERAL] update trigger not working

2005-10-19 Thread Oliver Elphick
t; RETURN NULL; RETURN NEW; > > END; > > $end$ language plpgsql; > > CREATE TRIGGER update_ts AFTER UPDATE ON table1 FOR and make this a BEFORE trigger > EACH ROW EXECUTE PROCEDURE update_ts(); -- Oliver Elphick olly@lfix.co.u

Re: [pgsql-advocacy] [GENERAL] Oracle buys Innobase

2005-10-19 Thread Oliver Elphick
e only people to install postgresql-client without the server would be those with multiple machines communicating with a server and a number of those might install the server by mistake. The ratio of nearly 6 to 4 seems quite reasonable. -- Oliver Elphick

Re: [GENERAL] supports de cours

2005-10-19 Thread Oliver Elphick
e Postquel language is long obsolete; for information about it you would have to search for the original Berkeley research papers. PostgreSQL uses standard SQL with a few extensions. See http://www.postgresql.org/docs/ -- Oliver Elphick olly@lfix.co.uk Isle o

Re: [GENERAL] License question[VASCL:A1077160A86]

2005-10-12 Thread Oliver Elphick
yright of all Debian packages is found in /usr/share/doc//copyright -- Oliver Elphick olly@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0

Re: [GENERAL] strange error

2005-10-11 Thread Oliver Elphick
t go wrong on the very first execution in a session or only on the second and subsequent executions? If the latter, try using EXECUTE in the function, so that the statement is reevaluated each time. -- Oliver Elphick olly@lfix.co.uk Isle o

Re: [GENERAL] brain-teaser with CONSTRAINT - any SQL experts?

2005-10-08 Thread Oliver Elphick
at table. Create a separate table with the two columns name and isbn which are that table's primary key; on the main table, create a foreign key to the new table. -- Oliver Elphick olly@lfix.co.uk Isle of Wight http://www

Re: [GENERAL] 8.1beta1 RPMs

2005-08-30 Thread Oliver Elphick
/8.1/beta1/rpms/ > > We hope these RPMs will help more people to test this new great release of > PostgreSQL. Martin Pitt has loaded Debian packages for postgresql-8.1 into the Debian experimental archive. -- Oliver Elphick olly@

Re: [GENERAL] selecting rows older than X, ensuring index is used

2005-08-20 Thread Oliver Elphick
gt; > There are over 550 rows in table1, so it doesn't look > the index is being used. Is there a way to rewrite > this query so the index is used? The estimate is that nearly half of those 550 rows will be returned, so a sequential scan would probably b

Re: [GENERAL] How to determine table schema in trigger function

2005-08-18 Thread Oliver Elphick
On Thu, 2005-08-18 at 17:02 +0300, Andrus wrote: > I created generic (for tables in different schemas) trigger function : > > CREATE OR REPLACE FUNCTION setlastchange() RETURNS "trigger" > AS $$BEGIN > UPDATE serverti SET lastchange='now' WHERE tablename=TG_RELNAME and >schemaname=TG_SCHEMA;

Re: [GENERAL] making another super user other than postgres

2004-11-12 Thread Oliver Elphick
lems for package installation scripts, which expect things to be as they are set up by the postgresql package. Oliver Elphick Debian maintainer for PostgreSQL ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] I'm about to release the next postgresql RFD.

2004-11-10 Thread Oliver Elphick
know in this thread. pgsql-performance gets a lot of posts and is probably relevant to nearly all users. -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E

[GENERAL] Ping Mike Cox

2004-11-10 Thread Oliver Elphick
Hey Mike Cocks!!! Kiss my bullocks you bloody wanker! Go bugger off and take your yank arse to Burger King, you uncultured American cretin. Twits like you make me proud to be a Brit. -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight

Re: [GENERAL] I have had enough

2004-11-10 Thread Oliver Elphick
g in the automatic checking to guard against forged sender addresses? -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A

Re: [GENERAL] server auto-restarts and ipcs

2004-11-09 Thread Oliver Elphick
On Tue, 2004-11-09 at 07:00 -0700, Ed L. wrote: > On Tuesday November 9 2004 2:16, Oliver Elphick wrote: > > On Mon, 2004-11-08 at 17:47 -0700, Ed L. wrote: > > > I often wonder why ipcs never seems to show the shared memory > > > block in question? > > > &g

Re: [GENERAL] server auto-restarts and ipcs

2004-11-09 Thread Oliver Elphick
nd you should see the PostgreQSL shared memory segment and semaphores. -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A54

Re: [GENERAL] Conactenating text with null values

2004-11-05 Thread Oliver Elphick
On Fri, 2004-11-05 at 09:25, Gregory S. Williamson wrote: > This is postgres 7.4 on a linux box ... > > I have driven myself to distraction trying to what ought to be easy. > > I have a table with house number, street direction, street name and > street suffix as 4 columns. I want to paste them t

Re: [GENERAL]: Unable to load libsqlpg.so

2004-11-03 Thread Oliver Elphick
r Debian Sarge, kernel 2.6.8-1? The kernel version should have nothing to do with it. Library loading is handled by the C library, libc6 and ldd.so. My first suggestion is to get a version of Kylix that is built for PostgreSQL 7.4. -- Oliver Elphick

Re: [GENERAL] export-import problem

2004-10-31 Thread Oliver Elphick
ady >> \. junk=# What precisely are you doing? -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310

Re: [GENERAL] basic debugging question

2004-10-26 Thread Oliver Elphick
ng clever I can access -- besides this list ;) -- so > I can >peek inside INSERT 18015 1 to see what pgres is thinking about? Try SELECT * FROM WHERE oid = 18015; If that returns nothing, the row must have been added to some other table, which would imply th

Re: [GENERAL] Newbie question about escaping in a function

2004-10-26 Thread Oliver Elphick
'' || quote_literal(tdat) || ''::TIMESTAMP + INTERVAL '' || quote_literal($2 || '' '' || $3) || '' AS x''; FOR result IN EXECUTE cmd LOOP return resu

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Oliver Elphick
On Mon, 2004-10-25 at 15:09 -0500, Naeem Bari wrote: > Ok, a really newbie question - I think I will switch to using "after" > rather than "before" - but can I modify the trigger statement without > dropping the trigger function? CREATE OR REPLACE FUN

Re: [GENERAL] how to port Oracle database to PostgreSQL?

2004-10-25 Thread Oliver Elphick
ou download (if you download the source). -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0

Re: [GENERAL] OID's

2004-10-23 Thread Oliver Elphick
e number (unless setval() were used to reset the sequence value). A lot of people seem not to understand that. The trade-off is that sequences are not rolled back if a transaction is aborted. -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight

Re: [GENERAL] Slony-I 1.0.4 Released

2004-10-23 Thread Oliver Elphick
he source tree does Slony-I need for its build? I could make a binary package to provide just those and make that one a Build-dependency for the Slony-I package. -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lf

Re: [GENERAL] Heritage

2004-09-08 Thread Oliver Elphick
. Alternatively, create a separate index of keys to the hierarchy and use it as the target for foreign key references. Use triggers to keep it up to date. -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/o

Re: [GENERAL] Function caches wrong OID of temporary table?

2004-09-08 Thread Oliver Elphick
t; I imagine that it has cached that one of the tables is object 590209, > but has not noticed that the table has been dropped and recreated before > the second invokation of the function. That is correct. You need to EXECUTE the command instead, so that

Re: [GENERAL] Postgresql and scripting

2004-09-08 Thread Oliver Elphick
u s t o m e r s t a b l e > $ echo '- - C r e a t e C u s t o m e r s t a b l e' | sed -e 's/\([^ ]\) \([^ ]\)/\1\2/g' -e 's/\([^ ]\) \([^ ]\)/\1\2/g' -e 's/ */ /g' -- Create Customers table -- Oliver Elphick

Re: [GENERAL] restricting non superuser from accessing other

2004-09-07 Thread Oliver Elphick
On Tue, 2004-09-07 at 15:38, Tom Lane wrote: > Oliver Elphick <[EMAIL PROTECTED]> writes: > > On Tue, 2004-09-07 at 14:35, David Garamond wrote: > >> Thanks! So I must modify and kill -HUP postmaster everytime a new db is > >> added. Is there something like this

Re: [GENERAL] DROP TRIGGER permission

2004-09-06 Thread Oliver Elphick
r than those of the user invoking it. -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA ==

[GENERAL] pg_autovacuum (7.4) nss_ldap oddity

2004-09-01 Thread Oliver Elphick
.conf specifies ldap; what I don't understand yet is what pg_autovacuum is doing differently from every other application so as to cause this message. Oliver Elphick ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an ind

Re: [GENERAL] Primary key inheritance problem

2004-08-29 Thread Oliver Elphick
On Sun, 2004-08-29 at 18:07, Matthew M Davis wrote: > On Sunday 29 August at 12:34pm, Oliver Elphick had this to say: > > > Primary and foreign key constraints are not inherited. This is a defect > > in the current system. > > It almost seems like a FEATURE to me, sinc

Re: [GENERAL] Primary key inheritance problem

2004-08-29 Thread Oliver Elphick
member of the hierarchy has a foreign key reference to it na has its own primary key on the referencing field. Use triggers to update the index table. -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/oliv

Re: [GENERAL] copy a database

2004-08-25 Thread Oliver Elphick
On Wed, 2004-08-25 at 17:09, Alvaro Herrera wrote: > On Wed, Aug 25, 2004 at 04:25:02PM +0100, Oliver Elphick wrote: > > Maybe recreating pg_user in the database will help. It is a global > > table, so if you have other databases where pg_user exists, copy the row > >

Re: [GENERAL] copy a database

2004-08-25 Thread Oliver Elphick
py the row from pg_class in that database to pg_class in the corrupted database. -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7

Re: [GENERAL] SELECT to an external file

2004-08-24 Thread Oliver Elphick
On Tue, 2004-08-24 at 18:08, Mário Gamito wrote: > Hi, > > How can i draw the results of a SELECT in to a file in the filesystem ? Using psql: 1. \o /path/to/file SELECT ... ; \o 2. psql -d my_database -c "SELECT ... " >/path/to/fi

Re: [GENERAL] Dump and Restore

2004-08-24 Thread Oliver Elphick
On Tue, 2004-08-24 at 17:36, Eduardo S. Fontanetti wrote: > I am using pg_dump. > > It means that I can't restore to a different name > database?? If you use pg_dump[all] without other options it will dump to a text file. Just edit the database name. -

Re: [GENERAL] problem with postgresql-dump while upgrading to 7.4

2004-08-20 Thread Oliver Elphick
erve should contain the 7.3 database; .../data should contain the new database, but apparnetly doesn't; db.out ought to be the dump as a text file. Take a look at the dump file, if it is there. Does it look complete? -- Oliver Elphick

Re: [GENERAL] Stored Procedures woes

2004-08-19 Thread Oliver Elphick
id=userId and group_id=groupId LOOP ... > update user_session set cost_bytes_in=costIn, > cost_bytes_out=costOut WHERE user_id=userId AND > session_id=us_rec.session_id; Are you somehow setting off an infinite recursion? How is this being called? Try putting

Re: [GENERAL] scripting & psql issues

2004-08-19 Thread Oliver Elphick
On Wed, 2004-08-18 at 16:26, Bob Parkinson wrote: > I've started to use the "here document" idea a lot when writing scripts to do tasks. > > #!/usr/local/bin/bash > > psql -d myDB < > select foo > update bar; > delete from ... > > EOSQL If the here document is long and complicated, you sh

Re: libpq: passwords WAS: [GENERAL] scripting & psql issues

2004-08-19 Thread Oliver Elphick
ash-digested password over and over, it would be no more secure than a plaintext one. Oliver Elphick ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] pg_dump feature request: Exclude tables?

2004-08-19 Thread Oliver Elphick
who uses shell commands must already be familiar with the need to quote wildcard characters which are not meant for the shell. One major utility which requires this is find; others that spring to mind are dpkg -l and mmv. Anyone who doesn't get it will very soon be educated; I don't see this

Re: [GENERAL] trouble with query

2004-08-04 Thread Oliver Elphick
S list. I suppose those are meant to be nulls - you should specify NULL instead of nothing at all: INSERT INTO form VALUES ('yes',NULL,'yes',NULL,'yes',NULL,'yes',...); The way you have written it is bad practice any way. You should use

Re: [GENERAL] Using view

2004-07-30 Thread Oliver Elphick
On Fri, 2004-07-30 at 09:17, Secrétariat wrote: > Hello ! > Why can't I update data when I use a VIEW instead of a TABLE ? Because a view is not a table. Many views are inherently non-updatable, and the backend assumes that all are. > How can I do similar action ? Create a rule on the view to u

Re: [GENERAL] pgadmin problem

2004-07-24 Thread Oliver Elphick
n that case you are not using TCP/IP to localhost, but a Unix socket. Try "psql -h localhost contacts" to see the difference. Edit $PGDATA/pg_hba.conf to change the settings (and then signal the postmaster or restart it). -- Oliver Elphick

Re: [GENERAL] phppgadmin and external access

2004-07-24 Thread Oliver Elphick
face of another computer, I > > have a "403 Forbidden" error. Do you know what is the solution? -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39

Re: [GENERAL] sorting and spaces in postgresql with en_US locale

2004-07-21 Thread Oliver Elphick
fined. Their sorting is dictionary style: spaces and capitalisation are ignored. This is a glibc issue, not a PostgreSQL issue. -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA

Re: [GENERAL] system catalog and varchar datatype

2004-07-19 Thread Oliver Elphick
is an "attlen" In the pg_attribute but this doesn't give any > information SELECT pg_catalog.format_type(a.atttypid, a.atttypmod) FROM pg_attribute AS a; would return "character varying(10)" or similar. -- Oliver Elphick

Re: [GENERAL] pgsql on debian

2004-06-27 Thread Oliver Elphick
'createdb root' jaydb. Sounds as if you created a database called 'root'. > but now i cannot access the db. > i get the follwing msgs > > psql: FATAL: database "jaydb" does not exist Use "psql -l" to list existing databases. -- Oliver E

Re: [GENERAL] making a copy of a table within the same database

2004-03-03 Thread Oliver Elphick
< dump.sql or edit on the fly (if the old table name doesn't occur except as a table name): pg_dump -d my_database -t old_table | sed -e 's/old_table/new_table/g' | psql -d my_database -- Oliver Elphick <[EMAIL PROTECTED]> LFIX Ltd

Re: [GENERAL] DBs and Schemas

2004-01-06 Thread Oliver Elphick
pplication to issue a > "set search_path = yourschema;" at the beginning, then the rest of the > application wouldn't need to change. That's what I did when I did > something similar. You can use ALTER DATABASE to set that up permanently, without touching the application.

Re: [GENERAL] Date column that defaults to 'now'

2004-01-05 Thread Oliver Elphick
and CURRENT_DATE remain the same within a transaction even if the time or date changes, whereas timeofday() always returns the current clock time. -- Oliver Elphick[EMAIL PROTECTED] Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024

Re: [GENERAL] GetLastInsertID ?

2004-01-01 Thread Oliver Elphick
specifying DEFAULT for the SERIAL field), or nextval() to get an id to use in the insert. -- Oliver Elphick[EMAIL PROTECTED] Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 0

Re: [GENERAL] restoring database

2003-12-22 Thread Oliver Elphick
e database to be restored. If you dumped in tar or special format, I believe you can use pg_restore -d dbname but I haven't done that myself and am not sure if I'm interpreting the manpage correctly. -- Oliver Elphick[EMAIL PR

Re: [GENERAL] ERROR: JOIN/USING types 'integer' and 'character

2003-12-11 Thread Oliver Elphick
.id and b.id are of different types.) That suggests an error in the query or a discrepancy in the data structures; but if it is intentional, cast one of them to match the other. -- Oliver Elphick[EMAIL PROTECTED] Isle of Wight, UK

Re: [GENERAL] GRANT ON C

2003-12-07 Thread Oliver Elphick
which is > not the postgres super-user I get a permission denied, and couldn't find how > to change that permission problem. > I the postgres super-user the only one that can create functions with LANGUAGE > C? Yes. Just think of all the things you can do in C with the backen

Re: [GENERAL] user defined variable per session

2003-12-07 Thread Oliver Elphick
> test=> \set myvar 5 > test=> select :myvar; > ?column? > -- > 5 > (1 row) But that is specific to psql. It's not something you can use in an application, as you might the Sybase command. -- Oliver Elphick

Re: [GENERAL] Money data type in PostgreSQL?

2003-12-03 Thread Oliver Elphick
NUMERIC > (exact numbers). The factor should range between 1E-3 (e.g. converting > IDR to USD) to 1E4 (e.g. converting IDR to pounds/euros). You should only use NUMERIC for money; any kind of floating point representation will lose detail somewhere along the line. (I suppose y

Re: [GENERAL] PostgreSQL from a newcomers perspective

2003-12-01 Thread Oliver Elphick
cket "/tmp/5432"? > in /path_to/filename.php on line 61 That socket path is wrong. It should be /tmp/.s.PGSQL.5432. How is PHP getting it? -- Oliver Elphick[EMAIL PROTECTED] Isle of Wight, UK http://www.lfix.co.uk/oliv

Re: [GENERAL] Humor me: Postgresql vs. MySql (esp. licensing)

2003-11-29 Thread Oliver Elphick
gives something (the consideration) to the other. A licence is one-sided. (However, a licence may itself be the consideration, as when you pay for commercial software.) -- Oliver Elphick[EMAIL PROTECTED] Isle of Wight, UK http://www.lfix.

Re: [GENERAL] Cron-job for checking up on pg_autovacuum

2003-11-29 Thread Oliver Elphick
ian package of 7.4 starts pg_autovacuum in the rc script if it is so configured. -- Oliver Elphick[EMAIL PROTECTED] Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839

Re: [GENERAL] PostgreSQL Advocacy, Thoughts and Comments

2003-11-29 Thread Oliver Elphick
WHERE t1.employee = t2.employee; That is not the same as using a sub-query: SELECT employee FROM t1 WHERE birthday > ( SELECT MIN(effectivedate) FROM t2 ); (select employees who were born after the longest-serving employee started work.) -- O

  1   2   3   >