How to insert a web link?
PostgreSQL database development
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What is interesting here?
• Duels
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Register!

QAIX > PostgreSQL database developmentGo to page: « previous | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | next »

  Top users: 
  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Модератор:
Thursday, 25 January 2007
Postgresql 64bit question Tony Caduto 17:54:25
 Hi,
I was just wondering if a 32bit client connected to a 64bit server,
would it be possible for the 64bit server to return a OID that was over
4 billion to the 32 bit
client and possibly cause a range error if the OID value was used in a
unsigned 32-bit integer var?

Thanks,

--
Tony


-------------------­--------(end of broadcast)---------­------------------
TIP 2: Don't 'kill -9' the postmaster

comment 1 answer | Add comment
Fix for bug in plpython bool type conversion Guido Goldstein 17:54:18
 Hi!

The attached patch fixes a bug in plpython.

This bug was found while creating sql from trigger functions
written in plpython and later running the generated sql.
The problem was that boolean was was silently converted to
integer, which is ok for python but fails when the created
sql is used.

The patch uses the Py_RETURN_xxx macros shown at
http://docs.python.­org/api/boolObjects.­html .

It would be nice if someone could test and comment
on the patch.

Cheers
Guido


--- postgresql-8.2.1.or­ig/src/pl/plpython/p­lpython.c2006-11-21 22:51:05.000000000 +0100
+++ postgresql-8.2.1/sr­c/pl/plpython/plpyth­on.c2007-01-17 18:06:58.185497734 +0100
@@ -1580,8 +1580,8 @@
PLyBool_FromString(­const char *src)
{
if (src[0] == 't')
-return PyInt_FromLong(1);
-return PyInt_FromLong(0);
+Py_RETURN_TRUE;
+Py_RETURN_FALSE;
}

static PyObject *



-------------------­--------(end of broadcast)---------­------------------
TIP 5: don't forget to increase your free space map settings
comment 3 answer | Add comment
Record Availability Brian Stapel 17:51:58
 Thanks for your time.

Are records created by performing function with in a function, immediately available to the calling function? For example, function A calls function B via the perform command. Function B creates new records. After function B completes and processing returns to function A, are the records created by function b available for further processing with in function A?


___________________­____________________­____________________­______
Get the Live.com Holiday Page for recipes, gift-giving ideas, and more.
www.live.com/?addte­mplate=holiday
Add comment
column limit? Shaunn Johnson 17:34:21
 Howdy:

Trying to looking for this in the docs, but, can someone clue me
in for the direction for column limit? I'm trying to build
a table with, say, 50+ columns (all but 2 of them are integer) and
getting some error (the error itself is ambiguous as it refers to
"'").

Is there a limit as to how many columns a table can have?
If so, what is it (or, where is the docs that explains
that stuff) ?

Thanks!

-X
comment 11 answers | Add comment
Re: Autovacuum Improvements Matthew O'Connor 16:59:20
 Bruce Momjian wrote:> Yes, I think there are these TODO items. I was waiting to see what> additional replies there are before adding them.

Speaking of which, I was just looking at the TODO at:

http://www.postgres­ql.org/docs/faqs.TOD­O.html

and I think this item:

* Improve xid wraparound detection by recording per-table rather than
per-database

is done and working in 8.2 no?


-------------------­--------(end of broadcast)---------­------------------
TIP 4: Have you searched our list archives?

http://archives.pos­tgresql.org/

comment 107 answers | Add comment
libeay32.dll & ssleay32.dll in system PATH Steven De Vriendt 13:53:24
 Hi,

When I try to install PostgreSQL8.2 I get this error message:

Incompactibel version of openssl detected in system path. when you remove
libeay32.dll & ssleay32.dll in your
system path postgres will install a newer version...

I've looked in my PATH but I can't seem to find it, can anyone help me out ?
comment 2 answer | Add comment
STOP all user access except for admin for a few minutes? Guest 12:32:35
 Hi there,

Is is possible to stop all user access to postgres, but still give access to
admin?
Just temporarily, not a security setup.

Something like, stop all users but allow user x and y.

thx


-------------------­--------(end of broadcast)---------­------------------
TIP 5: don't forget to increase your free space map settings

comment 7 answers | Add comment
Re: "tupdesc reference is not owned by resource owner Portal" Stefan Kaltenbrunner 12:14:51
 Tom Lane wrote:> Stefan Kaltenbrunner <stefan@kaltenbrunn­er.cc> writes:>> The following testcase(extracted from a much much larger production code >> sample) results in>
WARNING: TupleDesc reference leak: TupleDesc 0xb3573b88 (2249,1) still >> referenced>> CONTEXT: PL/pgSQL function "foo" line 4 at block variables initialization>> ERROR: tupdesc reference 0xb3573b88 is not owned by resource owner Portal>> CONTEXT: PL/pgSQL function "foo" while casting return value to >> function's return type>
Hmm. What's happening is that the record-function call creates a> reference-counted TupleDesc, and tracking of the TupleDesc is> assigned to the subtransaction resource owner because we're inside> an EXCEPTION-block subtransaction. But the pointer is held by the> function's eval_context which lives throughout the function call,> and so the free happens long after exiting the subtransaction, and> the resource owner code quite properly complains about this.>
In this particular case the worst consequence would be a short-term> memory leak, but I think there are probably variants with worse> problems, because anything done by a RegisterExprContext­Callback()> callback is equally at risk.>
I think the proper fix is probably to establish a new eval_context> when we enter an EXCEPTION block, and destroy it again on the way out.> Slightly annoying, but probably small next to the other overhead of> a subtransaction. Comments?

we use exception blocks heavily here so anything that makes them slower
is not nice but if it fixes the issue at hand I'm all for it ...
BTW, both of the CONTEXT lines are misleading. The WARNING happens> during exit from the begin-block, not entry to it; and the ERROR> happens after we've finished fooling with the result value. I'm> tempted to add a few more assignments to err_text to make this nicer.

yeah wondered about that too when I tried to produce a simple testcase -
the errors did't seem to make much sense in the context of what
triggered them. Improving that would be a very godd thing to do.


Stefan

-------------------­--------(end of broadcast)---------­------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresq­l.org so that your
message can get through to the mailing list cleanly

comment 2 answer | Add comment
Uninstall procedure for pgadmin3 under Mac OS X 10.3 Yannick DEVOS 11:04:16
 Dear pgadmin support community members,

I need your help for some tricky problem that I was unable to solve.

I am using pgadmin under Mac OS X Panther (10.3.9).
The newest pgadmin releases only support Tiger (10.4) since they are
compiled with dynamic links against 10.4 libraries and frameworks.
Some weeks ago, one of you kindely helped me (I think it was Dave, but
sorry, I am not sure anymore) in making a special 1.6.0 build for me.

Few days ago I decided to try 1.6.2 but I forgot that it does not work
with 10.3.
I installed it, and it crashes.

No problem, I thought, I just have to delete the pgadmin "binary" (in
fact a bundle under OS X "Applications" folder), and then install back
1.6.0 "Panther" build.
No way, the installation fails when I want to choose my apps disk in
"Choose target" screen. The error is a bit cryptic for me, the message
is (in fact it is in french, my translation could be errored) "You
cannot install this software on this volume. (null)".
I tried to delete preferences files or "Application support" files I
found in my "user"/Library, but it still failing...

What is the procedure to uninstall it ?
I looked after help or docs on the internet, but it was unsuccessfull.

Thanks for your help,
Yannick.

PS : You could told me that I'd better compile my own pgadmin build. I
will, but just for now I am too busy to spend time in compiling
wxwidgets and so on.
---
Hanh DOAN et Yannick DEVOS - Nature-Mekong
Savourer les d lices du delta
http://www.nature-m­ekong.com/

-------------------­--------(end of broadcast)---------­------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

comment 1 answer | Add comment
pg_get_domaindef() FAST PostgreSQL 10:18:06
 Hi All,

I am now trying to implement pg_get_domaindef() function which is in the TODO
list and ran into a minor issue.

When the following command is given

CREATE DOMAIN testdomain AS text CONSTRAINT testconstraint NOT NULL;

I couldn't find the CONSTRAINT name ('testconstraint' in this case) being
stored in the system catalog. Any idea where I can find it?

Or is it acceptable, for the above statement, for pg_get_domaindef() to
return

CREATE DOMAIN testdomain AS text CONSTRAINT NOT NULL;

Rgds,
Arul Shaji
This is an email from Fujitsu Australia Software Technology Pty Ltd, ABN 27 003 693 481. It is confidential to the ordinary user of the email address to which it was addressed and may contain copyright and/or legally privileged information. No one else may read, print, store, copy or forward all or any of it or its attachments. If you receive this email in error, please return to sender. Thank you.

If you do not wish to receive commercial email messages from Fujitsu Australia Software Technology Pty Ltd, please email unsubscribe@fast.fu­jitsu.com.au


-------------------­--------(end of broadcast)---------­------------------
TIP 5: don't forget to increase your free space map settings

comment 15 answers | Add comment
Re: pgsql: Fix for plpython functions; return true/false for boolean, Tom Lane 09:52:32
 momjian@postgresql.o­rg (Bruce Momjian) writes:> Fix for plpython functions; return true/false for boolean,

This patch has broken a majority of the buildfarm.

regards, tom lane

-------------------­--------(end of broadcast)---------­------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgres­ql.org/docs/faq

Add comment
indexing primary and foreign keys w/lookup table Neal Clark 09:26:26
 -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi All.

I was wondering...I currently have indexes on the primary key id and
foreign key id's for tables that resemble the following. Is this a
good idea/when would it benefit me? I don't want waste a lot of
unnecessary space on indexes.

CREATE TABLE stuff (
idBIGSERIAL PRIMARY KEY,
stuffTEXT
);
CREATE INDEX stuff_id ON stuff(id);

CREATE TABLE accounts (
idBIGSERIAL PRIMARY KEY,
nameTEXT,
emailTEXT,
);
CREATE INDEX accounts_id ON accounts(id);

CREATE TABLE stuff_by_account (
account_idBIGINT REFERENCES accounts(id),
stuff_idBIGINT REFERENCES stuff(id)
);
CREATE INDEX stuff_by_account_ac­count_id ON stuff_by_account
(account_id);
CREATE INDEX stuff_by_account_st­uff_id ON stuff_by_account(st­uff_id);

do I need any/all of these indexes for my lookup table to work well?
I am thinking I can get rid of stuff_id and accounts_id. Thoughts?

- -Neal
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFFuC6POUuHw4w­CzDMRArt1AJoC9QUwmTx­gcUKw+Agp+zYIDq/G/QC­golHT
oDFkLBCLjZBST7ypzbO­Ofew=
=CCSs
-----END PGP SIGNATURE-----

-------------------­--------(end of broadcast)---------­------------------
TIP 2: Don't 'kill -9' the postmaster

comment 3 answer | Add comment
Re: Example of RETURNING clause to get auto-generated keys Ken Johanson 08:53:51
 Adam Rich wrote:> Let's say you have a table with "id, value" columns.>
And your normal query would be this:>
INSERT into mytable (id,value) values (1,"foo"),(2,"bar")­;>
Your new query would be like this:>
INSERT into mytable (id,value) values (1,"foo"),(2,"bar")­> RETURNING id;>
And you would get a result back with one column (id) and> two rows (the newly inserted keys). You can also return> other fields if you like, you're not limited to just the> generated keys.>


Thank you Alvaro and Adam,

Now playing devil's advocate, can anyone see scenarios where this will
not work as expected? Examples (descriptions not sql necessarily) of
those would be helpful too...

Ken



-------------------­--------(end of broadcast)---------­------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgres­ql.org/docs/faq

comment 4 answer | Add comment
Re: Postgresql Backup Alan Hodgson 07:57:35
 On Wednesday 24 January 2007 20:57, "bala" <kbalavignesh@gmail­.com>
wrote:> 'script.sh' contains>
PGUSER=postgres pg_dumpall > /path/to/backup_dat­e.sql>
Running the script using crond creates the 0 byte files.>
But , If i run the script in console , it creates the file with> content.>
Any suggestion pls?

Include the full path to pg_dumpall in the script.
Make sure the postgres user can connect without a password or has an
appropriate .pgpass file in it's home directory.

--
No matter how disastrously some government policy has turned out, anyone
who criticizes it can expect to hear: 'But what would you replace it
with?' When you put out a fire, what do you replace it with?


-------------------­--------(end of broadcast)---------­------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresq­l.org so that your
message can get through to the mailing list cleanly

comment 1 answer | Add comment
[pgsql-patches] vc++ regression tests Magnus Hagander 07:35:33
 Attached is an updated patch for the win32/visualc++ specific parts of
my previous patch, not included in the parts applied by Alvaro.

For win32 in general, this makes it possible to run the regression tests
as an admin user by using the same restricted token method that's used
by pg_ctl and initdb.

For vc++, it adds building of pg_regress.exe, adds a resultmap, and
fixes how it runs the install.

//Magnus



Index: test/regress/pg_reg­ress.c
===================­====================­====================­========
RCS file: /projects/cvsroot/p­gsql/src/test/regres­s/pg_regress.c,v
retrieving revision 1.27
diff -c -r1.27 pg_regress.c
*** test/regress/pg_reg­ress.c19 Jan 2007 21:21:13 -00001.27
--- test/regress/pg_reg­ress.c23 Jan 2007 13:46:41 -0000
***************
*** 67,73 ****
--- 67,75 ----
static char *libdir = LIBDIR;
static char *datadir = PGSHAREDIR;
static char *host_platform = HOST_TUPLE;
+ #ifndef WIN32_ONLY_COMPILER­
static char *makeprog = MAKEPROG;
+ #endif

#ifndef WIN32/* not used in WIN32 case */
static char *shellprog = SHELLPROG;
***************
*** 133,138 ****
--- 135,144 ----
the supplied arguments. */
__attribute__((form­at(printf, 2, 3)));

+ #ifdef WIN32
+ typedef BOOL(WINAPI * __CreateRestrictedT­oken) (HANDLE, DWORD, DWORD, PSID_AND_ATTRIBUTES­, DWORD, PLUID_AND_ATTRIBUTE­S, DWORD, PSID_AND_ATTRIBUTES­, PHANDLE);
+ #endif
+
/*
* allow core files if possible.
*/
***************
*** 855,870 ****
return pid;
#else
char *cmdline2;
STARTUPINFO si;
PROCESS_INFORMATION­ pi;

ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);

cmdline2 = malloc(strlen(cmdli­ne) + 8);
sprintf(cmdline2, "cmd /c %s", cmdline);

! if (!CreateProcess(NUL­L, cmdline2, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
{
fprintf(stderr, _("could not start process for \"%s\": %lu\n"),
cmdline2, GetLastError());
--- 861,934 ----
return pid;
#else
char *cmdline2;
+ BOOL b;
STARTUPINFO si;
PROCESS_INFORMATION­ pi;
+ HANDLE origToken;
+ HANDLE restrictedToken;
+ SID_IDENTIFIER_AUTH­ORITY NtAuthority = {SECURITY_NT_AUTHOR­ITY};
+ SID_AND_ATTRIBUTES dropSids[2];
+ __CreateRestrictedT­oken _CreateRestrictedTo­ken = NULL;
+ HANDLE Advapi32Handle;

ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
+
+ Advapi32Handle = LoadLibrary("ADVAPI­32.DLL");
+ if (Advapi32Handle != NULL)
+ {
+ _CreateRestrictedTo­ken = (__CreateRestricted­Token) GetProcAddress(Adva­pi32Handle, "CreateRestrictedTo­ken");
+ }
+
+ if (_CreateRestrictedT­oken == NULL)
+ {
+ if (Advapi32Handle != NULL)
+ FreeLibrary(Advapi3­2Handle);
+ fprintf(stderr, "ERROR: Unable to create restricted tokens on this platform\n");
+ exit_nicely(2);
+ }
+
+ /* Open the current token to use as base for the restricted one */
+ if (!OpenProcessToken(­GetCurrentProcess(),­ TOKEN_ALL_ACCESS, &origToken))
+ {
+ fprintf(stderr, "Failed to open process token: %lu\n", GetLastError());
+ exit_nicely(2);
+ }
+
+ /* Allocate list of SIDs to remove */
+ ZeroMemory(&dropSid­s, sizeof(dropSids));
+ if (!AllocateAndInitia­lizeSid(&NtAuthority­, 2,
+ SECURITY_BUILTIN_DO­MAIN_RID, DOMAIN_ALIAS_RID_AD­MINS, 0, 0, 0, 0, 0, 0, &dropSids[0].Sid) ||
+ !AllocateAndInitial­izeSid(&NtAuthority,­ 2,
+ SECURITY_BUILTIN_DO­MAIN_RID, DOMAIN_ALIAS_RID_PO­WER_USERS, 0, 0, 0, 0, 0, 0, &dropSids[1].Sid))
+ {
+ fprintf(stderr, "Failed to allocate SIDs: %lu\n", GetLastError());
+ exit_nicely(2);
+ }
+
+ b = _CreateRestrictedTo­ken(origToken,
+ DISABLE_MAX_PRIVILE­GE,
+ sizeof(dropSids)/si­zeof(dropSids[0]),
+ dropSids,
+ 0, NULL,
+ 0, NULL,
+ &restrictedToken);
+
+ FreeSid(dropSids[1].Si­d);
+ FreeSid(dropSids[0].Si­d);
+ CloseHandle(origTok­en);
+ FreeLibrary(Advapi3­2Handle);
+
+ if (!b)
+ {
+ fprintf(stderr, "Failed to create restricted token: %lu\n", GetLastError());
+ exit_nicely(2);
+ }

cmdline2 = malloc(strlen(cmdli­ne) + 8);
sprintf(cmdline2, "cmd /c %s", cmdline);

! if (!CreateProcessAsUs­er(restrictedToken, NULL, cmdline2, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
{
fprintf(stderr, _("could not start process for \"%s\": %lu\n"),
cmdline2, GetLastError());
***************
*** 1690,1698 ****
--- 1754,1768 ----
make_directory(buf)­;

/* "make install" */
+ #ifndef WIN32_ONLY_COMPILER­
snprintf(buf, sizeof(buf),
SYSTEMQUOTE "\"%s\" -C \"%s\" DESTDIR=\"%s/instal­l\" install with_perl=no with_python=no > \"%s/log/install.lo­g\" 2>&1" SYSTEMQUOTE,
makeprog, top_builddir, temp_install, outputdir);
+ #else
+ snprintf(buf, sizeof(buf),
+ SYSTEMQUOTE "perl \"%s/src/tools/msvc­/install.pl\" \"%s/install\" >\"%s/log/install.l­og\" 2>&1" SYSTEMQUOTE,
+ top_builddir, temp_install, outputdir);
+ #endif
if (system(buf))
{
fprintf(stderr, _("\n%s: installation failed\nExamine %s/log/install.log for the reason.\nCommand was: %s\n"), progname, outputdir, buf);
Index: test/regress/result­map
===================­====================­====================­========
RCS file: /projects/cvsroot/p­gsql/src/test/regres­s/resultmap,v
retrieving revision 1.83
diff -c -r1.83 resultmap
*** test/regress/result­map3 Aug 2006 17:04:00 -00001.83
--- test/regress/result­map23 Jan 2007 13:52:11 -0000
***************
*** 1,8 ****
--- 1,11 ----
float4/i.86-pc-ming­w32=float4-exp-three­-digits
+ float4/i.86-pc-win3­2vc=float4-exp-three­-digits
float8/i.86-.*-free­bsd=float8-small-is-­zero
float8/i.86-.*-open­bsd=float8-small-is-­zero
float8/i.86-.*-netb­sd=float8-small-is-z­ero
float8/m68k-.*-netb­sd=float8-small-is-z­ero
float8/i.86-pc-ming­w32=float8-exp-three­-digits-win32
+ float8/i.86-pc-win3­2vc=float8-exp-three­-digits-win32
float8/i.86-pc-cygw­in=float8-small-is-z­ero
int8/i.86-pc-mingw3­2=int8-exp-three-dig­its
+ int8/i.86-pc-win32v­c=int8-exp-three-dig­its
\ No newline at end of file
Index: tools/msvc/Solution­.pm
===================­====================­====================­========
RCS file: /projects/cvsroot/p­gsql/src/tools/msvc/­Solution.pm,v
retrieving revision 1.6
diff -c -r1.6 Solution.pm
*** tools/msvc/Solution­.pm16 Jan 2007 21:43:19 -00001.6
--- tools/msvc/Solution­.pm23 Jan 2007 13:32:19 -0000
***************
*** 88,94 ****
print O "#define HAVE_LIBZ 1\n" if ($self->{options}->­{zlib});
print O "#define USE_SSL 1\n" if ($self->{options}->­{openssl});
print O "#define ENABLE_NLS 1\n" if ($self->{options}->­{nls});
! print O "#define LOCALEDIR \"/usr/local/pgsql/­share/locale\"\n" if ($self->{options}->­{nls});
if ($self->{options}->­{xml}) {
print O "#define HAVE_LIBXML2\n";
print O "#define USE_LIBXML\n";
--- 88,94 ----
print O "#define HAVE_LIBZ 1\n" if ($self->{options}->­{zlib});
print O "#define USE_SSL 1\n" if ($self->{options}->­{openssl});
print O "#define ENABLE_NLS 1\n" if ($self->{options}->­{nls});
! print O "#define LOCALEDIR \"/share/locale\"\n­" if ($self->{options}->­{nls});
if ($self->{options}->­{xml}) {
print O "#define HAVE_LIBXML2\n";
print O "#define USE_LIBXML\n";
***************
*** 202,218 ****
print "Generating pg_config_paths.h..­.\n";
open(O,'>', 'src\port\pg_config­_paths.h') || confess "Could not open pg_config_paths.h";­
print O <<EOF;
! #define PGBINDIR "/usr/local/pgsql/b­in"
! #define PGSHAREDIR "/usr/local/pgsql/s­hare"
! #define SYSCONFDIR "/usr/local/pgsql/e­tc"
! #define INCLUDEDIR "/usr/local/pgsql/i­nclude"
! #define PKGINCLUDEDIR "/usr/local/pgsql/i­nclude"
! #define INCLUDEDIRSERVER "/usr/local/pgsql/i­nclude/server"
! #define LIBDIR "/usr/local/pgsql/l­ib"
! #define PKGLIBDIR "/usr/local/pgsql/l­ib"
! #define LOCALEDIR "/usr/local/pgsql/s­hare/locale"
! #define DOCDIR "/usr/local/pgsql/d­oc"
! #define MANDIR "/usr/local/pgsql/m­an"
EOF
close(O);
}
--- 202,218 ----
print "Generating pg_config_paths.h..­.\n";
open(O,'>', 'src\port\pg_config­_paths.h') || confess "Could not open pg_config_paths.h";­
print O <<EOF;
! #define PGBINDIR "/bin"
! #define PGSHAREDIR "/share"
! #define SYSCONFDIR "/etc"
! #define INCLUDEDIR "/include"
! #define PKGINCLUDEDIR "/include"
! #define INCLUDEDIRSERVER "/include/server"
! #define LIBDIR "/lib"
! #define PKGLIBDIR "/lib"
! #define LOCALEDIR "/share/locale"
! #define DOCDIR "/doc"
! #define MANDIR "/man"
EOF
close(O);
}
Index: tools/msvc/install.­pl
===================­====================­====================­========
RCS file: /projects/cvsroot/p­gsql/src/tools/msvc/­install.pl,v
retrieving revision 1.1
diff -c -r1.1 install.pl
*** tools/msvc/install.­pl29 Nov 2006 19:49:31 -00001.1
--- tools/msvc/install.­pl23 Jan 2007 13:33:01 -0000
***************
*** 70,78 ****
open($D, "dir /b /s $spec |") || croak "Could not list $spec\n";
while (<$D>) {
chomp;
my $tgt = $target . basename($_);
print ".";
! copy($_, $tgt) || croak "Could not copy $_\n";
}
close($D);
print "\n";
--- 70,79 ----
open($D, "dir /b /s $spec |") || croak "Could not list $spec\n";
while (<$D>) {
chomp;
+ next if /regress/; # Skip temporary install in regression subdir
my $tgt = $target . basename($_);
print ".";
! copy($_, $tgt) || croak "Could not copy $_: $!\n";
}
close($D);
print "\n";
Index: tools/msvc/mkvcbuil­d.pl
===================­====================­====================­========
RCS file: /projects/cvsroot/p­gsql/src/tools/msvc/­mkvcbuild.pl,v
retrieving revision 1.10
diff -c -r1.10 mkvcbuild.pl
*** tools/msvc/mkvcbuil­d.pl16 Jan 2007 21:43:19 -00001.10
--- tools/msvc/mkvcbuil­d.pl23 Jan 2007 13:34:13 -0000
***************
*** 259,269 ****
}


! # Regression DLLs
my $regress = $solution->AddProje­ct('regress','dll','­misc');
$regress->AddFile('­src\test\regress\reg­ress.c');
$regress->AddRefere­nce($postgres);

$solution->Save();

###################­##
--- 259,276 ----
}


! # Regression DLL and EXE
my $regress = $solution->AddProje­ct('regress','dll','­misc');
$regress->AddFile('­src\test\regress\reg­ress.c');
$regress->AddRefere­nce($postgres);

+ my $pgregress = $solution->AddProje­ct('pg_regress','exe­','misc');
+ $pgregress->AddFile­('src\test\regress\p­g_regress.c');
+ $pgregress->AddIncl­udeDir('src\port');
+ $pgregress->AddDefi­ne('HOST_TUPLE="i686­-pc-win32vc"');
+ $pgregress->AddDefi­ne('FRONTEND');
+ $pgregress->AddRefe­rence($libpgport);
+
$solution->Save();

###################­##



-------------------­--------(end of broadcast)---------­------------------
TIP 2: Don't 'kill -9' the postmaster
comment 1 answer | Add comment
Re: [pgsql-patches] Tablespace for temporary Bruce Momjian 07:35:07
 
Patch withdrawn by author; corrected version expected.

-------------------­--------------------­--------------------­----------------

Jaime Casanova wrote:> On 1/13/07, Albert Cervera Areny <albertca@hotpop.co­m> wrote:> > It was already possible to set the guc on postgresql.conf when I posted the> > patch...> >
ok... fixed... the problem was that this code only let> num_temp_tablespace­s be greater than zero when we are in an> interactive command (eg. a SET command) but setting the guc from> postgresql.conf at startup time is not interactive so> num_temp_tablespace­s is zero and when i try to get the first temp> tablespace to use (MyProcPid % num_temp_tablespace­s) causes a floatin> exception (division by zero).>
+ if (source >= PGC_S_INTERACTIVE && IsTransactionState(­))> + {> + /*> + * Verify that all the names are valid tablspace names> + * We do not check for USAGE rights should we?> + */> + foreach(l, namelist)> + {> + char *curname = (char *) lfirst(l);> +> + if (get_tablespace_oid­(curname) == InvalidOid)> + ereport((source == PGC_S_TEST) ? NOTICE : ERROR,> + (errcode(ERRCODE_UN­DEFINED_OBJECT),> + errmsg("tablespace \"%s\" does not exist", curname)));> +> + num_temp_tablespace­s++;> + }> + }>
new patch added, with that piece of code refactored to let> num_temp_tablespace­s get a value greater than zero always that the guc> is setted, i also add some docs.>
the patch passes all 104 regression tests and all my tests as well...>
i think the patch is ready to be applied to HEAD, any committer want> to review it?>
-- > regards,> Jaime Casanova>
"Programming today is a race between software engineers striving to> build bigger and better idiot-proof programs and the universe trying> to produce bigger and better idiots.> So far, the universe is winning."> Richard Cook

[ Attachment, skipping... ]
-------------------­--------(end of broadcast)---------­------------------> TIP 5: don't forget to increase your free space map settings

--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterpri­sedb.com

+ If your life is a hard drive, Christ can be your backup. +

-------------------­--------(end of broadcast)---------­------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresq­l.org so that your
message can get through to the mailing list cleanly

comment 1 answer | Add comment
pg_trigger.tgargs needs detoast Kenji Kawamura 07:18:34
 Hello,

This patch fixes a bug of case of extraction of pg_trigger.tgargs.
There was a problem when we used a long argument in defining trigger,
possibly resulting in a server crash.

Example:

We defined a CREATE TRIGGER such as follows and registered trigger.
In this case, the argument value which we received in the trigger
procedure was not right.

CREATE TRIGGER trigger_test BEFORE INSERT OR UPDATE ON sample FOR EACH
ROW EXECUTE PROCEDURE sample_trig('XXX...­(more than 1823 characters)');

The trigger procedure which receives the argument:

Datum sample_trig(PG_FUNC­TION_ARGS)
{
TriggerData* trigdata = (TriggerData*)fcinf­o->context;
char** args = trigdata->tg_trigge­r->tgargs;
int nargs = trigdata->tg_trigge­r->tgnargs;

int i;
for (i = 0; i < nargs; i++) {
elog(LOG, "%s", args[i]);
}
...
}

Result:

Before: LOG: (the character that is not right, for example '%')
After : LOG: XXX...(more than 1823 characters)

Regards,

---
Kenji Kawamura
NTT Open Source Center, Japan



Index: src/backend/command­s/tablecmds.c
===================­====================­====================­========
--- src/backend/command­s/tablecmds.c(HEAD)
+++ src/backend/command­s/tablecmds.c(modifi­ed)
@@ -1800,8 +1800,7 @@
* line; so does trigger.c ...
*/
tgnargs = pg_trigger->tgnargs­;
-val = (bytea *)
-DatumGetPointer(fa­stgetattr(tuple,
+val = DatumGetByteaP(fast­getattr(tuple,
Anum_pg_trigger_tga­rgs,
tgrel->rd_att, &isnull));
if (isnull || tgnargs < RI_FIRST_ATTNAME_AR­GNO ||
Index: src/backend/command­s/trigger.c
===================­====================­====================­========
--- src/backend/command­s/trigger.c(HEAD)
+++ src/backend/command­s/trigger.c(modified­)
@@ -906,8 +906,7 @@
char *p;
inti;

-val = (bytea *)
-DatumGetPointer(fa­stgetattr(htup,
+val = DatumGetByteaP(fast­getattr(htup,
Anum_pg_trigger_tga­rgs,
tgrel->rd_att, &isnull));
if (isnull)
Index: src/backend/utils/a­dt/ruleutils.c
===================­====================­====================­========
--- src/backend/utils/a­dt/ruleutils.c(HEAD)­
+++ src/backend/utils/a­dt/ruleutils.c(modif­ied)
@@ -521,8 +521,7 @@
char *p;
inti;

-val = (bytea *)
-DatumGetPointer(fa­stgetattr(ht_trig,
+val = DatumGetByteaP(fast­getattr(ht_trig,
Anum_pg_trigger_tga­rgs,
tgrel->rd_att, &isnull));
if (isnull)



-------------------­--------(end of broadcast)---------­------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgres­ql.org/about/donate
comment 3 answer | Add comment
[ psqlodbc-Bugs-10011­72 ] Problem with ADO.RecordCount Guest 06:55:47
 Bugs item #1001172, was opened at 2007-01-02 17:32
You can respond by visiting:
http://pgfoundry.or­g/tracker/?func=deta­il&atid=538&aid=1001­172&group_id=1000125­

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Paul R ttgerding (paul1234)
Assigned to: Nobody (None)
Summary: Problem with ADO.RecordCount

Initial Comment:
Problem in ODBC and ADO

DatenbankInfos:
ADO Version: 2.8
DBMS Name: PostgreSQL
DBMS Version: 8.1.4
OLE DB Version: 02.00
Provider Name: MSDASQL.DLL
Provider Version: 02.81.1117.0
Transaktion: 8
ODBC Name: StudWerkPG
Driver Name: PSQLODBC35W.DLL
Driver Version: 08.02.0203
Driver ODBC Version: 03.51

The Select in PGAdmin 1.6 works.
1362 lines result.

(screenshot)

In Visual basic via ODBC and ADO it fails with:
-2147467259
Der Datenprovider oder ein anderer Dienst gab den Status E_FAIL zur ck.



rsstu.source =
select ISW_STUNDEN.IDMELDU­NG,sum(BruttoBetrag)­ as summ from ISW_STUNDEN,ISW_MEL­DUNGEN where IDOBJEKT=2 and OBJEKTTYP='GEBAEUDE­' and ISW_MELDUNGEN.IDMEL­DUNG=ISW_STUNDEN.IDM­ELDUNG group by ISW_STUNDEN.IDMELDU­NG

The Code:
'Stundenkosten
If rsStu.RecordCount > 0 Then E_Fail with RecordCount
rsStu.MoveFirst ' an den Anfang f r die erste Suche MoveFirst works ok
rsStu.Find "IDMELDUNG=" & .TextMatrix(i, 0) E_Fail with Find
If rsStu.EOF = False Then ' Objekt nicht vorhanden, deswegen nochmal von vorne durch alle Datens tze suchen
'Betr = IIf(IsNull(rsStu(1)­ = True), 0, rsStu(1))
Betr = DbGetSummenValue(rs­Stu, 1, , 0) 'IIf(IsNull(rsStu(1­) = True), 0, rsStu(1))
End If
End If


Test with rsStu.MoveLast fails also

Important: When I use an other where-clause and the resultset have per example 123 rows, all is OK !!
What can I do?
Thanks
Paul


-------------------­--------------------­--------------------­-----------

You can respond by visiting:
http://pgfoundry.or­g/tracker/?func=deta­il&atid=538&aid=1001­172&group_id=1000125­

-------------------­--------(end of broadcast)---------­------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgres­ql.org/about/donate

comment 3 answer | Add comment
Help with Degree Work Werner Echezuria 06:24:07
 Hello,

I've suscribed to this mailing list for help, I will work on a
Specialization Degree Thesis, this will be a PostgreSQL implementation of
fsql, or fuzzy querys.

http://www.lcc.uma.­es/~ppgg/FSQL.html, this is a link to a webpage who made
this in Oracle, but it's not inside of course, because it was made for other
people.

My work will be make this in the PostgreSQL Kernell, so i'll appreciate all
help you can bring.

Thanks.
comment 1 answer | Add comment
Idle in transaction - Explination .. Weslee Bilodeau 06:06:36
 Where I work I'm in charge of more then a few PostgreSQL databases.

I understand why idle in transaction is bad, however I have some
developers who I'm having a real difficult time fully explaining to them
why its bad.

Oh, and by bad I mean they have transactions that are sitting idle for
6+ hours at a time.

Mainly because they don't speak very good English, and my words like
MVCC and VACUUM have them tilting their heads wondering what language
I'm speaking.

I've tried searching the mailing lists for a good explanation, but
haven't really found one thats easy to translate.

They are Japanese, but I don't speak Japanese, so finding any resource
in Japanese that explains it is beyond my ability.

Would anyone happen to have a simple explanation, or a page online thats
written in Japanese that I can pass off that might explain why this is bad?

Is there a Wiki somewhere that says "101 ways to cause your DBA an
aneurysm" that covers things like this? :)­


Weslee


-------------------­--------(end of broadcast)---------­------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresq­l.org so that your
message can get through to the mailing list cleanly

comment 3 answer | Add comment
Problem with replace Slawosz 05:51:19
 Hello,
I have to relpace string
http://example.com/­index.php?module=art­icles&id= to string /module/ in
whole column in table. How exacly use replace? I noob in postgres, I
think it could be quite easy.
Please, help


-------------------­--------(end of broadcast)---------­------------------
TIP 5: don't forget to increase your free space map settings

comment 1 answer | Add comment
TODO list has removed developer names Bruce Momjian 05:51:13
 I have removed the developer names from the bottom of the TODO list now
that URLs are used to reference discussions. The URLs are much more
accurate than putting names on items.

--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterpri­sedb.com

+ If your life is a hard drive, Christ can be your backup. +

-------------------­--------(end of broadcast)---------­------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Add comment
[pgsql-patches] Allow dumping of roles or tablespaces Dave Page 05:30:43
 Per discussion on -hackers, the attached patch introduces an optional
parameter to pg_dumpall's -g (--globals-only) option to allow roles or
tablespaces to be dumped on their own.

eg.

pg_dumpall -g -- Dump roles and tablespaces per current behaviour
pg_dumpall -gr -- Dump roles only (or users and groups)
pg_dumpall -gt -- Dump tablespaces only

Regards, Dave.


Index: doc/src/sgml/ref/pg­_dumpall.sgml
===================­====================­====================­========
RCS file: /projects/cvsroot/p­gsql/doc/src/sgml/re­f/pg_dumpall.sgml,v
retrieving revision 1.58
diff -c -r1.58 pg_dumpall.sgml
*** doc/src/sgml/ref/pg­_dumpall.sgml7 Oct 2006 20:59:04 -00001.58
--- doc/src/sgml/ref/pg­_dumpall.sgml12 Jan 2007 14:01:10 -0000
***************
*** 130,140 ****
</varlistentry>

<varlistentry>
! <term><option>-g</o­ption></term>
! <term><option>--glo­bals-only</option></­term>
<listitem>
<para>
! Dump only global objects (users and groups), no databases.
</para>
</listitem>
</varlistentry>
--- 130,145 ----
</varlistentry>

<varlistentry>
! <term><option>-g[<re­placeable class="parameter">r­</replaceable>|<repl­aceable class="parameter">t­</replaceable></opti­on></term>
! <term><option>--glo­bals-only[=<replaceab­le class="parameter">r­</replaceable>|<repl­aceable class="parameter">t­</replaceable></opti­on></term>
<listitem>
<para>
! Dump only global objects (roles and/or tablespaces), no databases.
! The <replaceable class="parameter">r­</replaceable> parameter will
! cause only roles to be dumped, and the
! <replaceable class="parameter">t­</replaceable> parameter will cause
! only tablespaces to be dumped. If no parameter is specified, all
! global object types will be dumped.
</para>
</listitem>
</varlistentry>
Index: src/bin/pg_dump/pg_­dumpall.c
===================­====================­====================­========
RCS file: /projects/cvsroot/p­gsql/src/bin/pg_dump­/pg_dumpall.c,v
retrieving revision 1.86
diff -c -r1.86 pg_dumpall.c
*** src/bin/pg_dump/pg_­dumpall.c5 Jan 2007 22:19:48 -00001.86
--- src/bin/pg_dump/pg_­dumpall.c12 Jan 2007 14:01:12 -0000
***************
*** 78,83 ****
--- 78,85 ----
boolforce_password = false;
booldata_only = false;
boolglobals_only = false;
+ boolroles_only = false;
+ booltablespaces_onl­y = false;
boolschema_only = false;
PGconn *conn;
intencoding;
***************
*** 91,97 ****
{"inserts", no_argument, NULL, 'd'},
{"attribute-inserts­", no_argument, NULL, 'D'},
{"column-inserts", no_argument, NULL, 'D'},
! {"globals-only", no_argument, NULL, 'g'},
{"host", required_argument, NULL, 'h'},
{"ignore-version", no_argument, NULL, 'i'},
{"oids", no_argument, NULL, 'o'},
--- 93,99 ----
{"inserts", no_argument, NULL, 'd'},
{"attribute-inserts­", no_argument, NULL, 'D'},
{"column-inserts", no_argument, NULL, 'D'},
! {"globals-only", optional_argument, NULL, 'g'},
{"host", required_argument, NULL, 'h'},
{"ignore-version", no_argument, NULL, 'i'},
{"oids", no_argument, NULL, 'o'},
***************
*** 161,167 ****

pgdumpopts = createPQExpBuffer()­;

! while ((c = getopt_long(argc, argv, "acdDgh:ioOp:sS:U:v­WxX:", long_options, &optindex)) != -1)
{
switch (c)
{
--- 163,169 ----

pgdumpopts = createPQExpBuffer()­;

! while ((c = getopt_long(argc, argv, "acdDg::h:ioOp:sS:U­:vWxX:", long_options, &optindex)) != -1)
{
switch (c)
{
***************
*** 181,186 ****
--- 183,203 ----

case 'g':
globals_only = true;
+ if (optarg)
+ {
+ if (strcmp(optarg, "r") == 0)
+ roles_only = true;
+ else if(strcmp(optarg, "t") == 0)
+ tablespaces_only = true;
+ else
+ {
+ fprintf(stderr,
+ _("%s: invalid -g option -- %s\n"),
+ progname, optarg);
+ fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
+ exit(1);
+ }
+ }
break;

case 'h':
***************
*** 332,349 ****
printf("SET escape_string_warni­ng = 'off';\n");
printf("\n");

! /* Dump roles (users) */
! dumpRoles(conn);

! /* Dump role memberships --- need different method for pre-8.1 */
! if (server_version >= 80100)
! dumpRoleMembership(­conn);
! else
! dumpGroups(conn);

! /* Dump tablespaces */
! if (server_version >= 80000)
! dumpTablespaces(con­n);

/* Dump CREATE DATABASE commands */
if (!globals_only)
--- 349,372 ----
printf("SET escape_string_warni­ng = 'off';\n");
printf("\n");

! if (!tablespaces_only)­
! {
! /* Dump roles (users) */
! dumpRoles(conn);

! /* Dump role memberships --- need different method for pre-8.1 */
! if (server_version >= 80100)
! dumpRoleMembership(­conn);
! else
! dumpGroups(conn);
! }

! if (!roles_only)
! {
! /* Dump tablespaces */
! if (server_version >= 80000)
! dumpTablespaces(con­n);
! }

/* Dump CREATE DATABASE commands */
if (!globals_only)
***************
*** 381,387 ****
printf(_(" -c, --clean clean (drop) databases prior to create\n"));
printf(_(" -d, --inserts dump data as INSERT, rather than COPY, commands\n"));
printf(_(" -D, --column-inserts dump data as INSERT commands with column names\n"));
! printf(_(" -g, --globals-only dump only global objects, no databases\n"));
printf(_(" -o, --oids include OIDs in dump\n"));
printf(_(" -O, --no-owner skip restoration of object ownership\n"));
printf(_(" -s, --schema-only dump only the schema, no data\n"));
--- 404,410 ----
printf(_(" -c, --clean clean (drop) databases prior to create\n"));
printf(_(" -d, --inserts dump data as INSERT, rather than COPY, commands\n"));
printf(_(" -D, --column-inserts dump data as INSERT commands with column names\n"));
! printf(_(" -g, --globals-only=[r|t] dump only global objects, no databases. Optionally restrict to roles or tablespaces\n"));
printf(_(" -o, --oids include OIDs in dump\n"));
printf(_(" -O, --no-owner skip restoration of object ownership\n"));
printf(_(" -s, --schema-only dump only the schema, no data\n"));



-------------------­--------(end of broadcast)---------­------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresq­l.org so that your
message can get through to the mailing list cleanly
comment 6 answers | Add comment

Add new topic:

How:  Register )
 
Login:   Password:   
Comments by: Premoderation:
Topic:
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или законы РФ. Ваш ip-адрес записывается.


QAIX > PostgreSQL database developmentGo to page: « previous | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | next »

see also:
fix doc typo
getpeereid() for local ident
pass tests:
You and sex.
see also:
Hello!
How to convert DVD and Video to AVI
Privas!

  Copyright © 2001—2010 QAIX
Идея: Монашёв Михаил.
Авторами текстов, изображений и видео, размещённых на этой странице, являются пользователи сайта.
See Help and FAQ in the community support.qaix.com.
Write in the community about the bugs you have noticedbugs.qaix.com.
Write your offers and comments in the communities suggest.qaix.com.
Information for parents.
Пишите нам на .
If you would like to report an abuse of our service, such as a spam message, please .
Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .