~ubuntu-branches/ubuntu/utopic/pgadmin3/utopic-proposed

« back to all changes in this revision

Viewing changes to pgadmin/schema/pgCast.cpp

  • Committer: Package Import Robot
  • Author(s): Christoph Berg
  • Date: 2013-09-10 16:16:38 UTC
  • mfrom: (1.3.4)
  • Revision ID: package-import@ubuntu.com-20130910161638-wwup1q553ylww7dr
Tags: 1.18.0-1
* New upstream release.
* Don't install /usr/bin/png2c anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
//
3
3
// pgAdmin III - PostgreSQL Tools
4
4
//
5
 
// Copyright (C) 2002 - 2012, The pgAdmin Development Team
 
5
// Copyright (C) 2002 - 2013, The pgAdmin Development Team
6
6
// This software is released under the PostgreSQL Licence
7
7
//
8
8
// pgCast.cpp - Cast class
102
102
        if (sql.IsNull())
103
103
        {
104
104
                sql = wxT("-- Cast: ") + GetQuotedFullIdentifier() + wxT("\n\n")
105
 
                      wxT("-- DROP CAST (") + GetQuotedSchemaPrefix(GetSourceNamespace()) + GetSourceType() +
106
 
                      wxT(" AS ") + GetQuotedSchemaPrefix(GetTargetNamespace()) + GetTargetType() + wxT(")")
107
 
                      wxT("\n\nCREATE CAST (") + GetQuotedSchemaPrefix(GetSourceNamespace()) + GetSourceType() +
108
 
                      wxT(" AS ") + GetQuotedSchemaPrefix(GetTargetNamespace()) + GetTargetType();
 
105
                      wxT("-- DROP CAST (") + GetSourceType() +
 
106
                      wxT(" AS ") + GetTargetType() + wxT(");")
 
107
                      wxT("\n\nCREATE CAST (") + GetSourceType() +
 
108
                      wxT(" AS ") + GetTargetType();
109
109
                if (GetCastFunction().IsNull())
110
110
                        sql += wxT(")\n  WITHOUT FUNCTION");
111
111
                else
126
126
 
127
127
                properties->AppendItem(_("Name"), GetName());
128
128
                properties->AppendItem(_("OID"), GetOid());
129
 
                properties->AppendItem(_("Source type"), GetSchemaPrefix(GetSourceNamespace()) + GetSourceType());
130
 
                properties->AppendItem(_("Target type"), GetSchemaPrefix(GetTargetNamespace()) + GetTargetType());
 
129
                properties->AppendItem(_("Source type"), GetSourceType());
 
130
                properties->AppendItem(_("Target type"), GetTargetType());
131
131
                if (GetCastFunction().IsNull())
132
132
                        properties->AppendItem(_("Function"), _("(binary compatible)"));
133
133
                else
172
172
                           wxT("  JOIN pg_namespace nt ON nt.oid=tt.typnamespace\n")
173
173
                           wxT("  LEFT JOIN pg_proc pr ON pr.oid=castfunc\n")
174
174
                           wxT("  LEFT JOIN pg_namespace np ON np.oid=pr.pronamespace\n")
175
 
                           wxT("  LEFT OUTER JOIN pg_description des ON des.objoid=ca.oid AND des.objsubid=0\n")
 
175
                           wxT("  LEFT OUTER JOIN pg_description des ON (des.objoid=ca.oid AND des.objsubid=0 AND des.classoid='pg_cast'::regclass)\n")
176
176
                           + restriction + systemRestriction +
177
177
                           wxT(" ORDER BY st.typname, tt.typname"));
178
178