pgsql.novice
  Home FAQ Contact Sign in
pgsql.novice only
 
Advanced search
July 2008
motuwethfrsasuw
 123456 27
78910111213 28
14151617181920 29
21222324252627 30
28293031    31
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
pgsql.novice Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Re: Character set conversion         


Author: Tom Lane
Date: Jul 21, 2008 07:16

Bastiaan Olij writes:
> I read in the documentation about the 'Create conversion' command
> writing a function to do the conversion job. Is this the best way
> forward or are there better ways to attempt this? Is there any sample
> code available for implementing such a conversion? I don't want to
> reinvent the wheel here...

Look into the PG source code under
src/backend/utils/mb/conversion_procs.

While an add-on conversion procedure isn't too hard, I don't think
there's any way to define a whole new encoding without modifying the
source code --- the encodings are listed in some hard-coded tables
in the C code rather than being defined by a system catalog. It
wouldn't be too hard if you don't mind running a custom Postgres
build; but if you do, then the best answer might be to cannibalize
one of the existing encoding names and just replace its conversion
procedures.

regards, tom lane
Show full article (1.08Kb)
no comments
  tracking down idle transactions in pg_locks         


Author: David Gardner
Date: Jul 17, 2008 18:41

I've been tracking down a problem with idle transactions being left open
and not being able to vacuum one of my tables. I think I have tracked it
down to proprietary app, the problem seems to be that it leaves "idle
transactions" open.

However the table that we are having problems vacuuming (probably just
because it is the most active table) is in the same db, but a different
scheme not accessed by that app. Could this app still be causing the
problem?

I did a select on the pg_locks table and filtered by the pid of the idle
transaction. There were 8 locks, 7 were on tables that the app uses
however the 8th was of locktype=virtualxid and mode=ExclusiveLock. Could
this be some sort of global lock?

I have been able to verify that closing the app, does allow us to vacuum
the table.

--
David Gardner
Show full article (0.98Kb)
no comments
  updating table where one date field is null         


Author: richard terry
Date: Jul 17, 2008 14:54

I'm passing some information to postges (from gambas basic), which gets the
data from date type

eg date1 as date
date2 as date

(IN the postgres database the default on the date field is null)

my problem is that postgres baulks when I"ve not put a date into one of the
gambas date variables with the message:

"invalid syntax for type date '00:00:00'"

my sql is far more complex but reduced to the date part reads something like
this

insert into mytable (date1, date2) values

('01/01/2008','00:00:00')

I wondered if anyone could volunteer a solution

Regards

Richard

--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice
1 Comment
  Stopping a transaction as soon as an error occurs         


Author: Ridvan Lakas ng Bayan S. Baluyos
Date: Jul 16, 2008 21:49

Hi list,

I am dumping a series of data. Basically I'm migrating the tables from one
database to another. However, I wanted the transaction to stop immediately
as soon as the error below occurs:

psql:gravy.all.schema.sql:142136: ERROR: current transaction is aborted,
commands ignored until end of transaction block

What happens is that it continues to do the transaction even if there's
already a transaction and I'm having hard time catching it. I need to know
which line number the error first occured so that I can check my dump file
and do the necessary remedy.

Thanks,

Ridvan

--
Laurence J. Peter - "Originality is the fine art of remembering what you
hear but forgetting where you heard it."

Hi list,I am dumping a series of data. Basically I'm migrating the tables from one database to another. However, I wanted the transaction to stop immediately as soon as the error below occurs:
psql:gravy.all.schema.sql:142136: ERROR:  current transaction is aborted, commands ignored until end of transaction blockWhat happens is that it continues to do the transaction even if there's already a transaction and I'm having hard time catching it. I need to know which line number the error first occured so that  I can check my dump file and do the necessary remedy.
Thanks,Ridvan-- Laurence J. Peter  - "Originality is the fine art of remembering what you hear but forgetting where you heard it."
2 Comments
  Two novice questions         


Author: Wm.A.Stafford
Date: Jul 14, 2008 08:08

I have received a collection of scripts to be used to build a PostgreSQL
db and I can't figure out the following.

1. Usage of quotes in the scripts.
The following comes from a script to build and populate a table:
gid serial PRIMARY KEY,
"fid_" int4,
Why is the second column name in quotes, i.e. what is the difference
between fid_ int4 and "fid_" int 4.

In a similar vein, this comes from a script that creates a couple of
tables:
create table schema1."cache" ( ...
create table schema1.cache2 ( ...
Here one schema name is quoted and the other is not.

2. How does one run a script from PGAdmin? I have been 'opening' the
script file then hitting the run button. Is there a way to just specify
the path to the script?

Thanks for any help or pointers,
-=beeky
Show full article (0.94Kb)
4 Comments
  [PostgreSQL with OpenSolaris]Configuration         


Author: Leví Teodoro da Silva
Date: Jul 14, 2008 07:29

Hi guys,

I am a new user from PostgreSQL. I am trying to configure the PostgreSQL on
my OpenSolaris 2008.05 so i want to know if you know some links, articles or
tutorials about the first steps on PostgreSQl and how i could configure it
on my OpenSolaris.

Regards,
Levi

Hi guys,I am a new user from PostgreSQL. I am trying to configure the PostgreSQL on my OpenSolaris 2008.05 so i want to know if you know some links, articles or tutorials about the first steps on PostgreSQl and how i could configure it on my OpenSolaris.
Regards,Levi
no comments
  Dataimport from remote db         


Author: Schoenit, Tobias AT/BHL-ZTPS
Date: Jul 11, 2008 04:34

Hello,

i have several machines having the same database layout. Now i want
import data from a remote machine.

I tried something like this but maybe there is a better way in doing
such a thing???

CREATE OR REPLACE FUNCTION import_sc(text)
RETURNS int4 AS $$
DECLARE
v_host ALIAS FOR $1;
v_return int4;
v_constr text;
v_config record;
temp record;
BEGIN
v_constr := 'hostaddr=' || v_host || ' dbname=config
user=user password=pass';

-- connect to remote database
PERFORM 'SELECT dblink_connect(''con'', v_constr);';
RAISE NOTICE 'connected';
Show full article (1.56Kb)
1 Comment
  Dataimport from remote db         


Author: Schoenit, Tobias AT/BHL-ZTPS
Date: Jul 11, 2008 04:28

Hello,

i have several machines having the same database layout. Now i want
import data from a remote machine.

I tried something like this:

CREATE OR REPLACE FUNCTION import_sc(text)
RETURNS int4 AS $$
DECLARE
v_host ALIAS FOR $1;
v_return int4;
v_constr text;
v_config record;
temp record;
BEGIN
v_constr := 'hostaddr=' || v_host || ' dbname=config
user=user password=pass';

-- connect to remote database
PERFORM 'SELECT dblink_connect(''con'', v_constr);';
RAISE NOTICE 'connected';
Show full article (4.66Kb)
no comments
  Number of postgres connections         


Author: Ridvan Lakas ng Bayan S. Baluyos
Date: Jul 11, 2008 00:27

Hi list,

I've having a dilemma here. My problem here is that I'm getting maxed out of
my connection. My max connection is set to 100. I don't know if setting the
max connection higher is the right solution. My other alternative is to scan
through the application and check whether it closes the database connection.
We're currently using Propel as our ORM.

Thanks,

Ridvan

--
EB White - "Be obscure clearly."

Hi list,I've having a dilemma here. My problem here is that I'm getting maxed out of my connection. My max connection is set to 100. I don't know if setting the max connection higher is the right solution. My other alternative is to scan through the application and check whether it closes the database connection. We're currently using Propel as our ORM.
Thanks,Ridvan-- EB White  - "Be obscure clearly."
1 Comment
  function source         


Author: Wright, George
Date: Jul 10, 2008 08:47

Is there a way to hide/encrypt the source for functions I might write in
any of the procedural languages?

Doing \df+ shows all of it.

Is there a way to hide/encrypt the source for functions I
might write in any of the procedural languages?

 

Doing \df+ shows all of it.
5 Comments
 
1 2 3 4 5 6 7 8 9