Re: [GENERAL] How to create c language in postgresql database. Thanks.

2012-06-20 Thread yxj
Hi Albe,
 
Thanks. I will study it.
 
Regards.
 
Grace





At 2012-06-14 15:33:07,Albe Laurenz laurenz.a...@wien.gv.at wrote:
leaf_yxj wrote:
 Thanks for your answers. I really appreciate it. Although I don't
understand the whole things you guys
 mentioned to me. I think maybe I should do it by myself. I need to do
a test. If there is any good
 guide/white paper, please give me a link for me to study.

I think the documentation is quite good and comprehensive:

http://www.postgresql.org/docs/current/static/xfunc-c.html

If you look for samples, the contrib modules will serve.

Yours,
Laurenz Albe


Re: [GENERAL] How to create c language in postgresql database. Thanks.

2012-06-12 Thread yxj
Hi Tom,
 
Thanks. You guys are right. I check the database. The C programm is there.   
- but why our application team keep ask me to give them the superuser 
privileges to create the C function. Should they use the superuser to create 
the C function. if yes , why they need it?
 
Thanks.
Regards.
 
Grace





At 2012-06-13 01:55:52,Tom Lane t...@sss.pgh.pa.us wrote:
leaf_yxj leaf_...@163.com writes:
 I need to create  c language in the postgresql database.

Why do you think you need to do that?  It's built-in.

   regards, tom lane


Re: [GENERAL] How to write a script to analyze and vacuum all the tables in the system catalog?Thanks.

2012-05-18 Thread yxj
Hi Steve,
 
Thanks for your reply.
 
My Postgresql version is 8.2. I amn't sure we have the autovacuum job running 
or not? How can I check it ?
 
Thanks.
 
Grace





At 2012-05-18 02:53:15,Steve Crawford scrawf...@pinpointresearch.com wrote:
On 05/17/2012 11:30 AM, leaf_yxj wrote:
 Hi Guys. Please help me about this.

 For postgres database, it looks like we need analyze and vacuum all the
 tables periodly.  I need to write a script which can be executed in crontab.
 I don't have any clues about that. I only know the command :
 analyze tablename;
 vacuum tablename;
Leave off the tablename to do the whole db. But (unless you are on a 
really old version of PG) you really shouldn't need to manually vacuum 
things as that is the job of the autovacuum process.

There are unusual situations that suggest a manual analyze. It should be 
run right after a cluster for instance. But they are limited special cases.

What indicates that you need to vacuum or analyze via cron?

Cheers,
Steve



Re: [GENERAL] How to debug the performance issues via which system catalog.Thanks.

2012-05-18 Thread yxj
Hi Steve,
 
This is a very good website. We use the postgresql 8.2. there may be a little 
different. It's very useful to me.
 
Thanks.
Regards.
 
Grace





At 2012-05-18 03:02:41,Steve Crawford scrawf...@pinpointresearch.com wrote:
On 05/17/2012 11:54 AM, leaf_yxj wrote:
 I know we can know the currenct activity via pg_stat_activity. What's else
 you guys use to debug.
 And for some times back, how can we check the activities?

 Thanks.

 Grace
Performance is a complex enough issue to warrant its own mailing list 
(CPU type, number of cores, OS, OS settings, PG configuration, disk 
type/count/filesystem/raid-configuration and so on).

Greg Smith's PostgreSQL 9.0 High Performance is worth every penny.

While waiting for it to arrive, peruse the pages at 
http://wiki.postgresql.org/wiki/Performance_Optimization

Cheers,
Steve


Re: [GENERAL] Re: How to insert random character data into tables for testing purpose. THanks.

2012-05-03 Thread yxj
Hi Bruce,
 
Thanks. I tried. It works.
Regards.
 
Grace





At 2012-05-03 07:14:21,Bruce Momjian br...@momjian.us wrote:
On Wed, May 02, 2012 at 11:03:47AM -0700, leaf_yxj wrote:
 Hi Andreas,
 
 Thanks a lot.
 
 I tried those following , they work.
 
 1) insert into test values ( generate_series(1,1000),
 md5(random()::text));
 
 
 2) create table t_random as select s, md5(random()::text) from
 generate_Series(1,5) s;

Here is a method that generates strings with a little more variability:

   SELECT
(
SELECT string_agg(x, '')
FROM (
SELECT chr(ascii('A') + (random() * 25)::integer)
   -- reference 'b' so it is correlated and re-evaluated
FROM generate_series(1, 40 + b * 0)
) AS y(x)
)
   FROM generate_series(1,5) as a(b);
   
   string_agg
   --
JWNRUIEPJQGDVBXDJDTROFSNMKGVNAQWWEORMSHV
KNYGOWJXBEPOJICURIQGIIDFMRXYLFUUSTCIRLGR
PVHXEITVQKBZREFEVDDHHYCASEIKPOCFJJDNRWJJ
HKIYONDLQGSXFUXXZGHPUKUESXRLUATBLCAAPDLG
JEENYCLYISODDIGWGXHBYCCJECJTFUAOYECXGNWO
   (5 rows)

-- 
  Bruce Momjian  br...@momjian.ushttp://momjian.us
  EnterpriseDB http://enterprisedb.com

  + It's impossible for everything to be true. +


Re: [GENERAL] Limit the normal user to see system catalog or not??? And create privilege???

2012-05-03 Thread yxj
Hi Super Guys,
 
Thanks. I learned  a lot. It's very good for me to know that.
 
Regards.
 
Grace





At 2012-05-03 07:15:29,Bruce Momjian br...@momjian.us wrote:
On Wed, May 02, 2012 at 04:03:01PM -0700, Adrian Klaver wrote:
 On 05/02/2012 11:42 AM, Bruce Momjian wrote:
  On Wed, Mar 28, 2012 at 01:54:58PM -0700, Adrian Klaver wrote:
  On 03/28/2012 09:54 AM, leaf_yxj wrote:
  For oracle, the normal user can't see all the system catalog. but for
  postgresql, it looks like all the user can see the system catalog.  
  Should
  we limit the user read privilege to system catalog?
 
  In oracle, the system privilege has create table, create view,create
  function.  For postgresql database, how to control the user who only can
  create table but can't create view. Based on the test I did, once the 
  user
  has the create privilege on the schema, the user will have any create
  privilege on that schema. In postgresql, Rule is used to control that ???
  very confused!
 
  Path to unconfusion:):
  http://www.postgresql.org/docs/9.0/interactive/sql-grant.html
 
  You can grant CREATE on a schema and then restrict CREATE within the
  schema for different objects types. In recent versions you are
  looking for ALL * IN SCHEMA schema_name where * is the object type.
  
  I think the problem with ALL * IN SCHEMA it just applies permissions on
  all objects in the schema at a point in time, i.e. it doesn't apply to
  objects created _after_ that command was run.
 
 True, but in the above was an explanation of default privileges which
 led to this link:
 
 http://www.postgresql.org/docs/9.0/interactive/sql-alterdefaultprivileges.html
 
 ALTER DEFAULT PRIVILEGES does allow you to control what happens in the 
 future.
 Admittedly not the most obvious connection:)

Oh, I forgot about that one.

-- 
  Bruce Momjian  br...@momjian.ushttp://momjian.us
  EnterpriseDB http://enterprisedb.com

  + It's impossible for everything to be true. +


Re: [GENERAL] Test ODBC connection failed. Pleae help me to take a look. Thanks.

2012-04-30 Thread yxj
Hi Scott,
 
I amn't farmiliar with isql. Why I said isql is because that I did some 
research. they said something related to isql. No matter it's isql or psql.
 
1)How can I test the odbc function?
2) what's isql, in which circumstances , we use isql.
 
Thanks.
Regards.
 
Grace





At 2012-05-01 03:11:40,Scott Marlowe scott.marl...@gmail.com wrote:
On Mon, Apr 30, 2012 at 12:32 PM, leaf_yxj leaf_...@163.com wrote:
 These odbc drivers (psqlodbc-08.02.0400  psqlodbc-08.03.0400
 psqlodbc-09.00.0200 psqlodbc-08.02.0500  psqlodbc-08.04.0200) were
 installed. But I can't fine where the odbc.ini. After I set up my .odbc.ini.
 And setup the driver and driver manager environment variables, I still can't
 get the isql command. It still give me the error message that the isql
 command can't be found. Please help. Thanks. Grace

you want psql not isql.


Re: [GENERAL] Test ODBC connection failed. Pleae help me to take a look. Thanks.

2012-04-30 Thread yxj

Hi Chris,
 
Actually I only want to test ODBC. But I didn't have any idea to test. We have 
pgsqlodbc installed, but I don't how to test it. Please give me some clue.
 
Thanks.
 
Grace
 
At 2012-05-01 03:54:36,Chris Curvey ch...@chriscurvey.com wrote:
you want psql not isql.

On Mon, Apr 30, 2012 at 3:19 PM, yxj leaf_...@163.com wrote:

Hi Scott,
 
I amn't farmiliar with isql. Why I said isql is because that I did some 
research. they said something related to isql. No matter it's isql or psql.
 
1)How can I test the odbc function?
2) what's isql, in which circumstances , we use isql.
 
Thanks.
Regards.
 
Grace



I think Grace is trying to use the isql that comes with unixodbc in order to 
test her ODBC connection.


Grace, my isql is in /usr/bin/isql, but I'm on Ubuntu, and i think you're on 
CentOS.  (try locate isql)





Re: [GENERAL] how to set up automatically startup database when the server boot or reboot.

2012-04-27 Thread yxj
David, Thanks for your reminder. My database version is 8.2.15. And My os 
platform is Linux 5.5.  Thanks I really appreciate it. Grace





At 2012-04-27 22:36:51,David Johnston pol...@yahoo.com wrote:
PostgreSQL runs on numerous operating systems.  If you do not specify which 
one you are using, as well as how you went about installing PostgreSQl, no one 
is going to be able to help you.  The  PostgreSQL version would probably help 
as well.

David J.

On Apr 27, 2012, at 10:26, leaf_yxj leaf_...@163.com wrote:

 My company want to setup automatically startup database. For oracle database,
 there is a bullitin script and configuration of auto start when the server
 boot or reboot? Hi Guys, Please help. Thanks. Regards.Grace
 
 --
 View this message in context: 
 http://postgresql.1045698.n5.nabble.com/how-to-set-up-automatically-startup-database-when-the-server-boot-or-reboot-tp5670442p5670442.html
 Sent from the PostgreSQL - general mailing list archive at Nabble.com.
 
 -- 
 Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/mailpref/pgsql-general