[pgadmin-hackers] select inside transactions
I had to revert the patch on pgSetBase.cpp (Rev4986) because to handle the very special case of selects inside transactions when executed in a single step (I'd recommend to execute them step by step) the standard case of a query returning no data (e.g. drop table foo) didn't return messages any more. Regards, Andreas ---(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
[pgadmin-hackers] SVN Commit by andreas: r5005 - in trunk/pgadmin3: . src/base src/frm
Author: andreas Date: 2006-02-19 15:37:57 + (Sun, 19 Feb 2006) New Revision: 5005 Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5005&view=rev Log: Rearrange "view data" position in toolbar/menu Revert 4986 "Allow SELECT inside xact.." to have messages back Modified: trunk/pgadmin3/CHANGELOG trunk/pgadmin3/src/base/base.cpp trunk/pgadmin3/src/base/pgSetBase.cpp trunk/pgadmin3/src/frm/frmMain.cpp ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [pgadmin-hackers] SVN Commit by dpage: r5000 - in trunk/pgadmin3: . src/base src/include/base
[EMAIL PROTECTED] wrote: Author: dpage Date: 2006-02-17 10:49:24 + (Fri, 17 Feb 2006) New Revision: 5000 Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5000&view=rev Log: Properly escape single quotes in connection strings. This commit generates a warning all over the place: ../src/include/base/base.h:109:47: warning: multi-line comment Index: src/include/base/base.h === *** src/include/base/base.h (revision 5005) --- src/include/base/base.h (working copy) *** *** 105,112 // Quoting ! wxString qtString(const wxString& value); // add ' and escape if necessary ! wxString qtConnString(const wxString& value); // connection strings always have ' escaped with \ // check if size/pos have reasonable values void CheckOnScreen(wxPoint &pos, wxSize &size, const int w0=100, const int h0=70); --- 105,112 // Quoting ! wxString qtString(const wxString& value); // add ' and escape if necessary ! wxString qtConnString(const wxString& value); // connection strings always have ' escaped with a backslash // check if size/pos have reasonable values void CheckOnScreen(wxPoint &pos, wxSize &size, const int w0=100, const int h0=70); ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
[pgadmin-hackers] SVN Commit by andreas: r5006 - trunk/pgadmin3/src/include/base
Author: andreas Date: 2006-02-19 17:00:00 + (Sun, 19 Feb 2006) New Revision: 5006 Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5006&view=rev Log: Fix multiline comment warning Modified: trunk/pgadmin3/src/include/base/base.h ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [pgadmin-hackers] SVN Commit by dpage: r5000 - in trunk/pgadmin3:
Kris Jurka wrote: [EMAIL PROTECTED] wrote: Author: dpage Date: 2006-02-17 10:49:24 + (Fri, 17 Feb 2006) New Revision: 5000 Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5000&view=rev Log: Properly escape single quotes in connection strings. This commit generates a warning all over the place: Fixed in svn, thanks for reporting. Regards, Andreas ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [pgadmin-hackers] SVN Commit by dpage: r5003 - in trunk/pgadmin3: . src/base
[EMAIL PROTECTED] wrote:
Author: dpage
Date: 2006-02-17 11:05:34 + (Fri, 17 Feb 2006)
New Revision: 5003
Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5003&view=rev
Log:
Mask the password when logging the connection string.
This crashes for debug builds. Need to use .c_str() on the cleanConnStr.
Kris Jurka
Index: src/base/pgConnBase.cpp
===
*** src/base/pgConnBase.cpp (revision 5006)
--- src/base/pgConnBase.cpp (working copy)
***
*** 170,176
// Open the connection
wxString cleanConnStr = connstr;
cleanConnStr.Replace(qtConnString(password), wxT("'XX'"));
! wxLogInfo(wxT("Opening connection with connection string: %s"),
cleanConnStr);
#if wxUSE_UNICODE
wxCharBuffer cstrUTF=connstr.mb_str(wxConvUTF8);
--- 170,176
// Open the connection
wxString cleanConnStr = connstr;
cleanConnStr.Replace(qtConnString(password), wxT("'XX'"));
! wxLogInfo(wxT("Opening connection with connection string: %s"),
cleanConnStr.c_str());
#if wxUSE_UNICODE
wxCharBuffer cstrUTF=connstr.mb_str(wxConvUTF8);
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
[pgadmin-hackers] detecting serials in 8.1
8.1 has changed the default text for serials from something like
nextval('public.tab_col_seq'::text) to nextval('tab_col_seq'::regclass)
Kris Jurka
Index: src/schema/pgColumn.cpp
===
*** src/schema/pgColumn.cpp (revision 5006)
--- src/schema/pgColumn.cpp (working copy)
***
*** 126,136
{
wxString sql = GetQuotedTypename();
if ((sql == wxT("int4") || sql == wxT("int8") ||
sql == wxT("pg_catalog.int4") || sql == wxT("pg_catalog.int8"))
! && GetDefault() == wxT("nextval('")
! + schema->GetName() + wxT(".") + GetTableName()
! + wxT("_") + GetName() + wxT("_seq'::text)"))
{
if (sql.Right(4) == wxT("int8"))
sql = wxT("bigserial");
--- 126,150
{
wxString sql = GetQuotedTypename();
+ // Technically this serial check can still fail for sequences that
+ // get created with non-default names. Consider:
+ // CREATE SEQUENCE st_a_seq;
+ // CREATE TABLE st (a serial);
+ // Now the default's sequence is actually st_a_seq1.
+
+ wxString sequenceDefault;
+ if (GetDatabase()->BackendMinimumVersion(8, 1)) {
+ sequenceDefault = wxT("nextval('") + GetTableName()
+ + wxT("_") + GetName() + wxT("_seq'::regclass)");
+ } else {
+ sequenceDefault = wxT("nextval('")
+ + schema->GetName() + wxT(".") + GetTableName()
+ + wxT("_") + GetName() + wxT("_seq'::text)");
+ }
+
if ((sql == wxT("int4") || sql == wxT("int8") ||
sql == wxT("pg_catalog.int4") || sql == wxT("pg_catalog.int8"))
! && GetDefault() == sequenceDefault)
{
if (sql.Right(4) == wxT("int8"))
sql = wxT("bigserial");
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
Re: [pgadmin-hackers] select inside transactions
> I had to revert the patch on pgSetBase.cpp (Rev4986) because > to handle the very special case of selects inside > transactions when executed in a single step (I'd recommend to > execute them step by step) the standard case of a query > returning no data (e.g. drop table foo) didn't return > messages any more. Yikes. I guess my disclaimer was well placed ;-) Did you just revert it, or did you figure out a proper way of doing it? //Magnus ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
Re: [pgadmin-hackers] select inside transactions
Magnus Hagander wrote: I had to revert the patch on pgSetBase.cpp (Rev4986) because to handle the very special case of selects inside transactions when executed in a single step (I'd recommend to execute them step by step) the standard case of a query returning no data (e.g. drop table foo) didn't return messages any more. Yikes. I guess my disclaimer was well placed ;-) Did you just revert it, or did you figure out a proper way of doing it? Just reverted. Currently I don't see a proper way to implement it, unless multiple output panes (as in isqlw) are implemented. Regards, Andreas ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
[pgadmin-hackers] SVN Commit by andreas: r5007 - in branches/REL-1_4_0_PATCHES/pgadmin3/src: base schema
Author: andreas Date: 2006-02-19 19:55:48 + (Sun, 19 Feb 2006) New Revision: 5007 Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5007&view=rev Log: Fix serial column detection for 8.1 per Kris Jurka Modified: branches/REL-1_4_0_PATCHES/pgadmin3/src/base/pgConnBase.cpp branches/REL-1_4_0_PATCHES/pgadmin3/src/schema/pgColumn.cpp ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
[pgadmin-hackers] SVN Commit by andreas: r5008 - in trunk/pgadmin3: . src/base src/schema
Author: andreas Date: 2006-02-19 19:56:21 + (Sun, 19 Feb 2006) New Revision: 5008 Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5008&view=rev Log: Fix serial column detection for 8.1 per Kris Jurka Display column dependencies Modified: trunk/pgadmin3/CHANGELOG trunk/pgadmin3/TODO trunk/pgadmin3/src/base/pgConnBase.cpp trunk/pgadmin3/src/schema/pgColumn.cpp trunk/pgadmin3/src/schema/pgObject.cpp trunk/pgadmin3/src/schema/pgTable.cpp ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
Re: [pgadmin-hackers] SVN Commit by dpage: r5003 - in trunk/pgadmin3:
Kris Jurka wrote: [EMAIL PROTECTED] wrote: Author: dpage Date: 2006-02-17 11:05:34 + (Fri, 17 Feb 2006) New Revision: 5003 Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5003&view=rev Log: Mask the password when logging the connection string. This crashes for debug builds. Need to use .c_str() on the cleanConnStr. Hmpf, seems we had a small testing problem on the last patches... Fixed in SVN, thanks for reporting. Regards, Andreas ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [pgadmin-hackers] detecting serials in 8.1
Kris Jurka wrote:
8.1 has changed the default text for serials from something like
nextval('public.tab_col_seq'::text) to nextval('tab_col_seq'::regclass)
Applied with editing (didn't check for schema).
+ // Technically this serial check can still fail for sequences that
+ // get created with non-default names. Consider:
+ // CREATE SEQUENCE st_a_seq;
+ // CREATE TABLE st (a serial);
+ // Now the default's sequence is actually st_a_seq1.
This can't be created consistently using the CREATE TABLE foo (bar
serial) syntax, instead the column default syntax would need to be used.
I've put this on the TODO list, we'd need some discussion what reverse
engineering we really should show in such cases. This also has to
correspond with our column dialog, which will add pg_depend
automatically if adding a serial to an existing table (thus mimicking
the CREATE TABLE ... SERIAL stuff).
Regards,
Andreas
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
[pgadmin-hackers] SVN Commit by andreas: r5009 - trunk/pgadmin3/src/schema
Author: andreas Date: 2006-02-19 20:06:19 + (Sun, 19 Feb 2006) New Revision: 5009 Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5009&view=rev Log: gtk fix Modified: trunk/pgadmin3/src/schema/pgObject.cpp ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [pgadmin-hackers] detecting serials in 8.1
Andreas Pflug wrote:
Kris Jurka wrote:
8.1 has changed the default text for serials from something like
nextval('public.tab_col_seq'::text) to nextval('tab_col_seq'::regclass)
Applied with editing (didn't check for schema).
Actually it turns out that whether the schema gets in there or not
depends on the search path when the table is created. Consider the
following code:
CREATE schema s1;
CREATE schema s2;
SET search_path TO 's1';
CREATE TABLE t1 (a serial);
CREATE TABLE s2.t2 (a serial);
SET search_path TO 'public';
SELECT relname,attname,adsrc
FROM pg_class c, pg_attribute a, pg_attrdef d
WHERE c.oid = d.adrelid AND c.oid = a.attrelid
AND a.attnum = d.adnum
AND c.relname IN ('t1','t2');
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
Re: [pgadmin-hackers] SVN Commit by dpage: r5003 - in trunk/pgadmin3: . src/base
-Original Message- From: "Andreas Pflug"<[EMAIL PROTECTED]> Sent: 19/02/06 19:57:13 To: "Kris Jurka"<[EMAIL PROTECTED]> Cc: "[email protected]", "[email protected]" Subject: Re: [pgadmin-hackers] SVN Commit by dpage: r5003 - in trunk/pgadmin3: . src/base > Hmpf, seems we had a small testing problem on the last patches... Hmm, worked fine in VC. I wonder if we can "borrow" the PG buildfarm code and make our own farm. Guess I'd need to fix the mingw build first... > Fixed in SVN, thanks for reporting. Yes, thanks. Regards, Dave -Unmodified Original Message- Kris Jurka wrote: > [EMAIL PROTECTED] wrote: > >> Author: dpage >> >> Date: 2006-02-17 11:05:34 + (Fri, 17 Feb 2006) >> >> New Revision: 5003 >> >> Revision summary: >> http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5003&view=rev >> >> Log: >> Mask the password when logging the connection string. >> > > This crashes for debug builds. Need to use .c_str() on the cleanConnStr. Hmpf, seems we had a small testing problem on the last patches... Fixed in SVN, thanks for reporting. Regards, Andreas ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [pgadmin-hackers] detecting serials in 8.1
Kris Jurka wrote:
Andreas Pflug wrote:
Kris Jurka wrote:
8.1 has changed the default text for serials from something like
nextval('public.tab_col_seq'::text) to nextval('tab_col_seq'::regclass)
Applied with editing (didn't check for schema).
Actually it turns out that whether the schema gets in there or not
depends on the search path when the table is created.
That's what pgSchema::GetPrefix does too.
Regards,
Andreas
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
Re: [pgadmin-hackers] detecting serials in 8.1
Andreas Pflug wrote: Kris Jurka wrote: Actually it turns out that whether the schema gets in there or not depends on the search path when the table is created. That's what pgSchema::GetPrefix does too. That's fine as long as you assume that the search path never changes and as long as you only have one schema in your search path. I don't think these are assumptions we can make. Kris Jurka ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
