1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Add ALTER TYPE ... ADD/DROP/ALTER/RENAME ATTRIBUTE

Like with tables, this also requires allowing the existence of
composite types with zero attributes.

reviewed by KaiGai Kohei
This commit is contained in:
Peter Eisentraut
2010-09-26 14:41:03 +03:00
parent 899beb7894
commit e440e12c56
15 changed files with 636 additions and 148 deletions

View File

@@ -7249,13 +7249,7 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo)
res = PQexec(g_conn, query->data);
check_sql_result(res, g_conn, query->data, PGRES_TUPLES_OK);
/* Expecting at least a single result */
ntups = PQntuples(res);
if (ntups < 1)
{
write_msg(NULL, "query returned no rows: %s\n", query->data);
exit_nicely();
}
i_attname = PQfnumber(res, "attname");
i_atttypdefn = PQfnumber(res, "atttypdefn");
@@ -7356,12 +7350,12 @@ dumpCompositeTypeColComments(Archive *fout, TypeInfo *tyinfo)
res = PQexec(g_conn, query->data);
check_sql_result(res, g_conn, query->data, PGRES_TUPLES_OK);
/* Expecting at least a single result */
ntups = PQntuples(res);
if (ntups < 1)
{
write_msg(NULL, "query returned no rows: %s\n", query->data);
exit_nicely();
PQclear(res);
destroyPQExpBuffer(query);
return;
}
pgClassOid = atooid(PQgetvalue(res, 0, PQfnumber(res, "tableoid")));